From 3c13a34c712793823ee2536d8990879d768cf73a Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 26 Sep 2014 13:29:49 -0400 Subject: improve so it finishes consistently --- cmake/run_test.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cmake/run_test.cmake') diff --git a/cmake/run_test.cmake b/cmake/run_test.cmake index 2a1db8db..5aa5abbf 100644 --- a/cmake/run_test.cmake +++ b/cmake/run_test.cmake @@ -20,10 +20,20 @@ separate_arguments(test_args) execute_process( COMMAND ${test_cmd} ${test_args} + RESULT_VARIABLE test_not_successful + ERROR_VARIABLE err +) + +if(test_not_successful) + message(SEND_ERROR "Unable to run test '${test_cmd}': ${err} : shell output: ${test_not_successful}!") +endif() + +execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files ${output_blessed} ${output_test} RESULT_VARIABLE test_not_successful + ERROR_VARIABLE err ) if(test_not_successful) - message(SEND_ERROR "${output_test} does not match ${output_blessed}!") + message(SEND_ERROR "Output does not match for ${output_blessed} and ${output_test}: ${err} : shell output: ${test_not_successful}!") endif() -- cgit v1.2.1