cmake_cpputest_template/.template_files/modules/TestCMakeLists.txt

14 lines
507 B
Plaintext
Raw Normal View History

# The module_name module tests
list(APPEND TEST_LIBS "${CMOCKA_LIBRARIES}")
list(APPEND TEST_LIBS module_name)
list(APPEND TEST_DIRS "${CMOCKA_INCLUDE_DIRS}")
list(APPEND TEST_DIRS "${PROJECT_SOURCE_DIR}/src")
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}")