Commit 7197411d authored by Tom Finegan's avatar Tom Finegan
Browse files

cmake: Report failure to shell when a test fails.

Exit the CMake script using message(FATAL_ERROR) to ensure test
failures return a failure code to the controlling shell.


Change-Id: Idf7fb9736c617fa7dea7364b27d6a5b208634e7c
parent 26177d9e
...@@ -20,3 +20,7 @@ set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS}) ...@@ -20,3 +20,7 @@ set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS})
execute_process(COMMAND ${TEST_LIBAOM} RESULT_VARIABLE test_result) execute_process(COMMAND ${TEST_LIBAOM} RESULT_VARIABLE test_result)
set(test_message "Test shard ${GTEST_SHARD_INDEX}/${GTEST_TOTAL_SHARDS} result") set(test_message "Test shard ${GTEST_SHARD_INDEX}/${GTEST_TOTAL_SHARDS} result")
message("${test_message}: ${test_result}") message("${test_message}: ${test_result}")
if (NOT "${test_result}" STREQUAL "0")
message(FATAL_ERROR "${test_message}: FAILED, non-zero exit code.")
endif ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment