1set(ENV{SYST_UNITTESTING} "1")
2string(REPLACE "^" ";" OPTIONS ${OPTIONS})
3
4execute_process(
5    COMMAND ${EXECUTABLE} ${OPTIONS}
6    OUTPUT_FILE ${TEST_OUTPUT}
7    RESULT_VARIABLE EXIT_CODE
8)
9
10if(EXIT_CODE)
11    message(FATAL_ERROR "execution of ${EXECUTABLE} ${OPTIONS} failed")
12endif(EXIT_CODE)
13
14execute_process(
15    COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_REFERENCE} ${TEST_OUTPUT}
16    RESULT_VARIABLE DIFF_FAIL
17)
18
19if (DIFF_FAIL)
20    message(FATAL_ERROR "Reference match failed.")
21endif(DIFF_FAIL)