Detect cmake test result.

This commit is contained in:
Zhang Xianyi 2015-10-20 03:35:25 +08:00
parent 94b125255f
commit aca7d7e953
1 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,14 @@ endforeach()
# $1 exec, $2 input, $3 output_result # $1 exec, $2 input, $3 output_result
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.sh FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.sh
"rm -f $3\n" "rm -f $3\n"
"$1 < $2" "$1 < $2\n"
"grep -q FATAL $3\n"
"if [ $? -eq 0 ]; then\n"
"echo Error\n"
"exit 1\n"
"else\n"
"exit 0\n"
"fi\n"
) )
set(float_types s d c z) set(float_types s d c z)