With different test
This commit is contained in:
@@ -82,20 +82,26 @@ else()
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(test_file ${TEST_FILES})
|
add_executable(ut_test_1
|
||||||
get_filename_component(test_name ${test_file} NAME_WE) # utFoo
|
include/Package.hpp
|
||||||
add_executable(${test_name}
|
src/Package.cpp
|
||||||
${SRC_FILES}
|
test/ut_Package.cpp
|
||||||
${INCLUDE_FILES}
|
|
||||||
${test_file}
|
|
||||||
)
|
)
|
||||||
target_link_libraries(${test_name} PRIVATE GTest::gtest_main)
|
|
||||||
target_include_directories(${test_name} PRIVATE ${INCLUDE_DIR})
|
|
||||||
target_compile_options(${test_name} PRIVATE ${TARGET_COMPILER_OPTIONS})
|
|
||||||
|
|
||||||
include(GoogleTest)
|
add_executable(ut_test_2
|
||||||
gtest_discover_tests(${test_name})
|
include/Package.hpp
|
||||||
endforeach()
|
include/MainDish.hpp
|
||||||
|
include/SideDish.hpp
|
||||||
|
include/Drink.hpp
|
||||||
|
include/Food.hpp
|
||||||
|
src/Package.cpp
|
||||||
|
src/MainDish.cpp
|
||||||
|
src/SideDish.cpp
|
||||||
|
src/Drink.cpp
|
||||||
|
src/Food.cpp
|
||||||
|
test/ut_Package.cpp
|
||||||
|
test/ut_Food.cpp
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(ut_all
|
add_executable(ut_all
|
||||||
${SRC_FILES}
|
${SRC_FILES}
|
||||||
@@ -103,6 +109,25 @@ add_executable(ut_all
|
|||||||
${TEST_FILES}
|
${TEST_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(ut_test_1
|
||||||
|
GTest::gtest_main
|
||||||
|
)
|
||||||
|
target_include_directories(ut_test_1 PRIVATE
|
||||||
|
${INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
target_compile_options(ut_test_1 PRIVATE
|
||||||
|
${TARGET_COMPILER_OPTIONS}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(ut_test_2
|
||||||
|
GTest::gtest_main
|
||||||
|
)
|
||||||
|
target_include_directories(ut_test_2 PRIVATE
|
||||||
|
${INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
target_compile_options(ut_test_2 PRIVATE
|
||||||
|
${TARGET_COMPILER_OPTIONS}
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(ut_all
|
target_link_libraries(ut_all
|
||||||
GTest::gtest_main
|
GTest::gtest_main
|
||||||
|
|||||||
Reference in New Issue
Block a user