31 lines
584 B
CMake
31 lines
584 B
CMake
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..."
|
|
)
|