add CMAKEList tests

This commit is contained in:
Willy 2026-06-08 14:14:03 +02:00
parent 14866848dc
commit b05277eeee
1 changed files with 28 additions and 29 deletions

View File

@ -39,32 +39,31 @@ target_link_libraries(TestJenkins
# -----------------------------------------------------------------------------
# GoogleTest
# -----------------------------------------------------------------------------
#
#include(FetchContent)
#
#FetchContent_Declare(
# googletest
# URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
#)
#
#FetchContent_MakeAvailable(googletest)
#
#add_executable(UT_Person
# tests/UT_Person.cpp
#)
#
#target_link_libraries(UT_Person
# PRIVATE
# Person
# GTest::gtest
# GTest::gtest_main
#)
#
#include(GoogleTest)
#gtest_discover_tests(UT_Person)
#
## Optional: place executables in a common output folder
#set_target_properties(TestJenkins UT_Person PROPERTIES
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
#)
#
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
)
FetchContent_MakeAvailable(googletest)
add_executable(UT_Person
tests/UT_Person.cpp
)
target_link_libraries(UT_Person
PRIVATE
Person
GTest::gtest
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(UT_Person)
# Optional: place executables in a common output folder
set_target_properties(TestJenkins UT_Person PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)