Better Quality Test
This commit is contained in:
parent
59f4b2c10d
commit
6b0719a667
@ -1,39 +1,29 @@
|
|||||||
# vim: et ts=4 sts=4 sw=4 tw=0
|
# vim: et ts=4 sts=4 sw=4 tw=0
|
||||||
|
|
||||||
add_executable(jsoncpp_test
|
ADD_EXECUTABLE(jsoncpp_test
|
||||||
jsontest.cpp
|
jsontest.cpp
|
||||||
jsontest.h
|
jsontest.h
|
||||||
fuzz.cpp
|
fuzz.cpp
|
||||||
fuzz.h
|
fuzz.h
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(jsoncpp_test PRIVATE jsoncpp::framework)
|
||||||
if(BUILD_SHARED_LIBS)
|
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0)
|
|
||||||
add_compile_definitions( JSON_DLL )
|
|
||||||
else()
|
|
||||||
add_definitions( -DJSON_DLL )
|
|
||||||
endif()
|
|
||||||
target_link_libraries(jsoncpp_test jsoncpp_lib)
|
|
||||||
else()
|
|
||||||
target_link_libraries(jsoncpp_test jsoncpp_static)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# another way to solve issue #90
|
# another way to solve issue #90
|
||||||
#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store)
|
#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store)
|
||||||
|
|
||||||
## Create tests for dashboard submission, allows easy review of CI results https://my.cdash.org/index.php?project=jsoncpp
|
## Create tests for dashboard submission, allows easy review of CI results https://my.cdash.org/index.php?project=jsoncpp
|
||||||
add_test(NAME jsoncpp_test
|
ADD_TEST(NAME jsoncpp_test
|
||||||
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
|
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
|
||||||
)
|
)
|
||||||
set_target_properties(jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test)
|
SET_TARGET_PROPERTIES(jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test)
|
||||||
|
|
||||||
# Run unit tests in post-build
|
# Run unit tests in post-build
|
||||||
# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?)
|
# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?)
|
||||||
if(JSONCPP_WITH_POST_BUILD_UNITTEST)
|
IF (JSONCPP_WITH_POST_BUILD_UNITTEST)
|
||||||
add_custom_command(TARGET jsoncpp_test
|
ADD_CUSTOM_COMMAND(TARGET jsoncpp_test
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
|
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:jsoncpp_test>
|
||||||
)
|
)
|
||||||
endif()
|
ENDIF ()
|
||||||
|
Loading…
Reference in New Issue
Block a user