mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00

From the libpng licensing point of view, the build projects, the build scripts, the test scripts, the CI verification scripts, et cetera, have not traditionally been part of libpng proper, although some of these, including the CMake-based build, have been released under the libpng license. Considering how the CMake build grew as a result of many contributions from many contributing authors over a long time, one may argue that it almost became an individual piece of software in its own right. Moving on, everything CMake-related shall be placed in the subdirectory scripts/cmake/ (except, of course, the main CMakeLists.txt). Moreover, contributing authors shall be acknowledged in scripts/cmake/AUTHORS.md. Please see scripts/cmake/README.md for more information.
35 lines
1.1 KiB
CMake
35 lines
1.1 KiB
CMake
# test.cmake.in
|
|
|
|
# Copyright (c) 2024 Cosmin Truta
|
|
# Copyright (c) 2016 Glenn Randers-Pehrson
|
|
# Written by Roger Leigh, 2016
|
|
#
|
|
# Use, modification and distribution are subject to
|
|
# the same licensing terms and conditions as libpng.
|
|
# Please see the copyright notice in png.h or visit
|
|
# http://libpng.org/pub/png/src/libpng-LICENSE.txt
|
|
#
|
|
# SPDX-License-Identifier: libpng-2.0
|
|
|
|
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()
|
|
|
|
message("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()
|