From 4c78b58973dae59511705aba3ead8ad6dd8b7bc7 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Sat, 16 Mar 2024 13:42:47 -0700 Subject: [PATCH] changed the test template to target cpputest --- .template_files/modules/TestCMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.template_files/modules/TestCMakeLists.txt b/.template_files/modules/TestCMakeLists.txt index fe0aea3..c011cea 100644 --- a/.template_files/modules/TestCMakeLists.txt +++ b/.template_files/modules/TestCMakeLists.txt @@ -1,13 +1,10 @@ -# The module_name module tests -list(APPEND TEST_LIBS "${CMOCKA_LIBRARIES}") -list(APPEND TEST_LIBS module_name) +# TEST_RUNNER +add_library(module_name_test + module_name.cpp +) -list(APPEND TEST_DIRS "${CMOCKA_INCLUDE_DIRS}") -list(APPEND TEST_DIRS "${PROJECT_SOURCE_DIR}/src") +target_link_libraries(module_name_test + ${CPPUTEST_LIBRARIES}/libCppUTest.a + ${CPPUTEST_LIBRARIES}/libCppUTestExt.a +) -add_cmocka_test(test_module_name - SOURCES test_module_name.c - COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS} - LINK_LIBRARIES "${TEST_LIBS}") -add_cmocka_test_environment(test_module_name) -target_include_directories(test_module_name PUBLIC "${TEST_DIRS}")