3 # Copyright (C) 2016 Glenn Randers-Pehrson
4 # Written by Roger Leigh, 2016
6 # This code is released under the libpng license.
7 # For conditions of distribution and use, see the disclaimer
10 set(TEST_OPTIONS "@TEST_OPTIONS@")
11 set(TEST_FILES "@TEST_FILES@")
13 foreach(file ${TEST_FILES})
14 file(TO_NATIVE_PATH "${file}" native_file)
15 list(APPEND NATIVE_TEST_FILES "${native_file}")
18 # Add the directory containing libpng to the PATH (Windows only)
20 get_filename_component(LIBPNG_DIR "${LIBPNG}" PATH)
21 file(TO_NATIVE_PATH "${LIBPNG_DIR}" LIBPNG_DIR)
22 set(ENV{PATH} "${LIBPNG_DIR};$ENV{PATH}")
25 execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "Running ${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES})
27 execute_process(COMMAND "${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES}
28 RESULT_VARIABLE TEST_STATUS)
30 message(FATAL_ERROR "Returned failed status ${TEST_STATUS}!")