examples/ctest/test_hello.cmake
raw| 1 | execute_process( |
| 2 | COMMAND "${CTESTEXAMPLE_COMMAND}" |
| 3 | RESULT_VARIABLE CTESTEXAMPLE_RESULT |
| 4 | OUTPUT_VARIABLE CTESTEXAMPLE_OUTPUT |
| 5 | ) |
| 6 | |
| 7 | if(NOT CTESTEXAMPLE_RESULT EQUAL "0") |
| 8 | message(FATAL_ERROR "ctestexample returned non-zero value\nActual result: ${CTESTEXAMPLE_RESULT}") |
| 9 | endif() |
| 10 | |
| 11 | if(NOT CTESTEXAMPLE_OUTPUT STREQUAL "Hello world!\n") |
| 12 | message(FATAL_ERROR "ctestexample did not print \"Hello world!\"\nActual result:\n${CTESTEXAMPLE_OUTPUT}") |
| 13 | endif() |