changed the test template to target cpputest

This commit is contained in:
jakeg00dwin 2024-03-16 13:42:47 -07:00
parent 04352629b2
commit 4c78b58973
1 changed files with 8 additions and 11 deletions

View File

@ -1,13 +1,10 @@
# The module_name module tests # TEST_RUNNER
list(APPEND TEST_LIBS "${CMOCKA_LIBRARIES}") add_library(module_name_test
list(APPEND TEST_LIBS module_name) module_name.cpp
)
list(APPEND TEST_DIRS "${CMOCKA_INCLUDE_DIRS}") target_link_libraries(module_name_test
list(APPEND TEST_DIRS "${PROJECT_SOURCE_DIR}/src") ${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}")