feat(lib): initialize libnextcloud C++17 library scaffolding (#25)
This commit is contained in:
30
shared/tests/CMakeLists.txt
Normal file
30
shared/tests/CMakeLists.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
# Find Google Test
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
# Include Google Test helpers
|
||||
include(GoogleTest)
|
||||
|
||||
# Test executable
|
||||
add_executable(smoke_test
|
||||
smoke_test.cpp
|
||||
)
|
||||
|
||||
# Link against the library and GTest
|
||||
target_link_libraries(smoke_test
|
||||
PRIVATE
|
||||
nextcloud
|
||||
GTest::GTest
|
||||
GTest::Main
|
||||
)
|
||||
|
||||
# Discover and register tests
|
||||
gtest_discover_tests(smoke_test)
|
||||
|
||||
# Add custom target to run tests
|
||||
add_custom_target(run_tests
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
|
||||
DEPENDS smoke_test
|
||||
COMMENT "Running tests..."
|
||||
)
|
||||
Reference in New Issue
Block a user