1#
2# This file is used to executed given unit test commands locally, handling
3# additional arguments like 'exhaustive' and setting the DCMDICTPATH
4# environment variable appropriately.
5#
6
7set(ENV{DCMDICTPATH} "@DCMDICTPATH@")
8
9execute_process(COMMAND
10    "${DCMTK_CTEST_TESTCASE_COMMAND}" $ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "${DCMTK_CTEST_TEST_NAME}"
11    RESULT_VARIABLE RESULT
12)
13
14# We cannot forward the result value to CMake, so print it instead and let CMake
15# return with code '1' or whatever it deems appropriate to notify about an error.
16if(RESULT)
17    message(FATAL_ERROR "Test command returned: ${RESULT}")
18endif()
19