2017-01-16 16:36:11 +03:00
|
|
|
add_library(unity unity/src/unity.c)
|
2017-01-16 16:52:01 +03:00
|
|
|
|
|
|
|
if(ENABLE_CJSON_TEST)
|
|
|
|
#copy test files
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inputs")
|
|
|
|
file(GLOB test_files "inputs/*")
|
|
|
|
file(COPY ${test_files} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/inputs/")
|
|
|
|
|
|
|
|
set(unity_tests
|
|
|
|
parse_examples
|
2017-01-17 03:53:55 +03:00
|
|
|
parse_number
|
2017-01-17 21:44:38 +03:00
|
|
|
parse_hex4
|
2017-02-04 04:12:10 +03:00
|
|
|
parse_string
|
2017-02-06 18:27:59 +03:00
|
|
|
parse_array
|
2017-01-16 16:52:01 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
foreach(unity_test ${unity_tests})
|
|
|
|
add_executable("${unity_test}" "${unity_test}.c")
|
|
|
|
target_link_libraries("${unity_test}" "${CJSON_LIB}" unity)
|
|
|
|
add_test("${unity_test}" "${unity_test}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|