[cmake] Fixed cram module not failing when the cram tests fail
This commit is contained in:
parent
60de40708d
commit
e8ec14e276
2 changed files with 11 additions and 5 deletions
|
@ -12,7 +12,6 @@ set(PATH_VAR
|
||||||
set(NEW_PATH "")
|
set(NEW_PATH "")
|
||||||
foreach (P ${PATH_VAR})
|
foreach (P ${PATH_VAR})
|
||||||
file (TO_NATIVE_PATH "${P}" P)
|
file (TO_NATIVE_PATH "${P}" P)
|
||||||
message ("${P}")
|
|
||||||
list (APPEND NEW_PATH "${P}")
|
list (APPEND NEW_PATH "${P}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
set (PATH_VAR "${NEW_PATH}")
|
set (PATH_VAR "${NEW_PATH}")
|
||||||
|
@ -24,8 +23,6 @@ else ()
|
||||||
set(ENV{PATH} "$ENV{PATH};${PATH_VAR}")
|
set(ENV{PATH} "$ENV{PATH};${PATH_VAR}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message ("path = $ENV{PATH}")
|
|
||||||
|
|
||||||
set(ENV{LC_ALL} "en_US.utf8")
|
set(ENV{LC_ALL} "en_US.utf8")
|
||||||
set(ENV{CRITERION_ALWAYS_SUCCEED} "1")
|
set(ENV{CRITERION_ALWAYS_SUCCEED} "1")
|
||||||
set(ENV{CRITERION_SHORT_FILENAME} "1")
|
set(ENV{CRITERION_SHORT_FILENAME} "1")
|
||||||
|
@ -33,4 +30,8 @@ set(ENV{CRITERION_NO_EARLY_EXIT} "1")
|
||||||
set(ENV{CRITERION_JOBS} "1")
|
set(ENV{CRITERION_JOBS} "1")
|
||||||
set(ENV{CRITERION_DISABLE_TIME_MEASUREMENTS} "1")
|
set(ENV{CRITERION_DISABLE_TIME_MEASUREMENTS} "1")
|
||||||
|
|
||||||
execute_process (COMMAND cram -v ${CRAM_PATH})
|
execute_process (COMMAND cram -v "${CRAM_PATH}" TIMEOUT 60 RESULT_VARIABLE RES)
|
||||||
|
|
||||||
|
if (NOT RES STREQUAL "0")
|
||||||
|
message (FATAL_ERROR "Cram tests failed")
|
||||||
|
endif ()
|
||||||
|
|
|
@ -36,7 +36,12 @@ set_property(TEST criterion_unit_tests PROPERTY
|
||||||
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
||||||
add_custom_target(cram_tests)
|
add_custom_target(cram_tests)
|
||||||
|
|
||||||
add_custom_command(TARGET cram_tests POST_BUILD COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/Cram.cmake")
|
add_custom_command(TARGET cram_tests POST_BUILD
|
||||||
|
COMMAND "${CMAKE_COMMAND}"
|
||||||
|
-DPROJECT_BINARY_DIR="${PROJECT_BINARY_DIR}"
|
||||||
|
-DCRAM_PATH="${CMAKE_CURRENT_SOURCE_DIR}/cram"
|
||||||
|
-P "${CMAKE_MODULE_PATH}/Cram.cmake"
|
||||||
|
)
|
||||||
add_dependencies(cram_tests criterion_samples)
|
add_dependencies(cram_tests criterion_samples)
|
||||||
|
|
||||||
add_test(cram_tests make cram_tests)
|
add_test(cram_tests make cram_tests)
|
||||||
|
|
Loading…
Add table
Reference in a new issue