2019-11-19 14:31:44 +01:00
|
|
|
ADD_SUBDIRECTORY(cram)
|
2020-01-08 19:47:22 +01:00
|
|
|
ADD_SUBDIRECTORY(shunit2)
|
2019-11-19 14:31:44 +01:00
|
|
|
|
|
|
|
MACRO(ADD_UNIT_TEST name)
|
|
|
|
ADD_EXECUTABLE(${name} ${name}.c)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} ubox blobmsg_json json_script ${json})
|
|
|
|
TARGET_INCLUDE_DIRECTORIES(${name} PRIVATE ${PROJECT_SOURCE_DIR})
|
|
|
|
ENDMACRO(ADD_UNIT_TEST)
|
|
|
|
|
|
|
|
FILE(GLOB test_cases "test-*.c")
|
|
|
|
FOREACH(test_case ${test_cases})
|
2019-12-08 13:12:47 +01:00
|
|
|
GET_FILENAME_COMPONENT(test_case ${test_case} NAME_WE)
|
|
|
|
ADD_UNIT_TEST(${test_case})
|
|
|
|
ADD_UNIT_TEST_SAN(${test_case})
|
2019-11-19 14:31:44 +01:00
|
|
|
ENDFOREACH(test_case)
|
2019-12-08 15:11:02 +01:00
|
|
|
|
|
|
|
IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
|
|
ADD_SUBDIRECTORY(fuzz)
|
|
|
|
ENDIF()
|