Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/png/libpng/scripts/test.cmake.in')
-rw-r--r--src/png/libpng/scripts/test.cmake.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/png/libpng/scripts/test.cmake.in b/src/png/libpng/scripts/test.cmake.in
new file mode 100644
index 000000000..fa6a889bb
--- /dev/null
+++ b/src/png/libpng/scripts/test.cmake.in
@@ -0,0 +1,31 @@
+# test.cmake.in
+
+# Copyright (C) 2016 Glenn Randers-Pehrson
+# Written by Roger Leigh, 2016
+
+# This code is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h
+
+set(TEST_OPTIONS "@TEST_OPTIONS@")
+set(TEST_FILES "@TEST_FILES@")
+
+foreach(file ${TEST_FILES})
+ file(TO_NATIVE_PATH "${file}" native_file)
+ list(APPEND NATIVE_TEST_FILES "${native_file}")
+endforeach()
+
+# Add the directory containing libpng to the PATH (Windows only)
+if(WIN32)
+ get_filename_component(LIBPNG_DIR "${LIBPNG}" PATH)
+ file(TO_NATIVE_PATH "${LIBPNG_DIR}" LIBPNG_DIR)
+ set(ENV{PATH} "${LIBPNG_DIR};$ENV{PATH}")
+endif()
+
+execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "Running ${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES})
+
+execute_process(COMMAND "${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES}
+ RESULT_VARIABLE TEST_STATUS)
+if(TEST_STATUS)
+ message(FATAL_ERROR "Returned failed status ${TEST_STATUS}!")
+endif()