2016-05-11 00:25:54 +00:00
|
|
|
# The unit test executable.
|
2016-05-18 09:25:36 +00:00
|
|
|
set(JSON_UNITTEST_TARGET_NAME "json_unit")
|
|
|
|
add_executable(${JSON_UNITTEST_TARGET_NAME}
|
2016-05-11 00:25:54 +00:00
|
|
|
"src/catch.hpp"
|
|
|
|
"src/unit.cpp"
|
2016-08-04 05:24:46 +00:00
|
|
|
"src/unit-runner.cpp"
|
2016-05-11 00:25:54 +00:00
|
|
|
)
|
|
|
|
|
2016-05-18 09:25:36 +00:00
|
|
|
set_target_properties(${JSON_UNITTEST_TARGET_NAME} PROPERTIES
|
2016-05-11 00:25:54 +00:00
|
|
|
CXX_STANDARD 11
|
|
|
|
CXX_STANDARD_REQUIRED ON
|
|
|
|
COMPILE_DEFINITIONS "$<$<CXX_COMPILER_ID:MSVC>:_SCL_SECURE_NO_WARNINGS>"
|
|
|
|
COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>"
|
|
|
|
)
|
|
|
|
|
2016-05-18 09:25:36 +00:00
|
|
|
target_include_directories(${JSON_UNITTEST_TARGET_NAME} PRIVATE "src")
|
|
|
|
target_link_libraries(${JSON_UNITTEST_TARGET_NAME} ${JSON_TARGET_NAME})
|
2016-05-11 00:38:52 +00:00
|
|
|
|
2016-05-18 09:25:36 +00:00
|
|
|
add_test(NAME "${JSON_UNITTEST_TARGET_NAME}_default"
|
|
|
|
COMMAND ${JSON_UNITTEST_TARGET_NAME}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
add_test(NAME "${JSON_UNITTEST_TARGET_NAME}_all"
|
|
|
|
COMMAND ${JSON_UNITTEST_TARGET_NAME} "*"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
)
|