From f2a3b020402943f90957552a884788e70ece6cd7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Jun 2017 20:46:10 +0000 Subject: * .travis.yml, build/travis-ci: new files from 0001-ci-Add-Travis-support-for-Linux-builds-with-Autoconf.patch by Roger Leigh (sent to mailing list on 2017-06-08) This patch adds support for the Travis-CI service. * .appveyor.yml: new file from 0002-ci-Add-AppVeyor-support.patch by Roger Leigh (sent to mailing list on 2017-06-08) This patch adds a .appveyor.yml file to the top-level. This allows one to opt in to having a branch built on Windows with Cygwin, MinGW and MSVC automatically when a branch is pushed to GitHub, GitLab, BitBucket or any other supported git hosting service. * CMakeLists.txt, test/CMakeLists.txt, test/TiffTestCommon.cmake: apply patch 0001-cmake-Improve-Cygwin-and-MingGW-test-support.patch from Roger Leigh (sent to mailing list on 2017-06-08) This patch makes the CMake build system support running the tests with MinGW or Cygwin. --- test/CMakeLists.txt | 29 +++++++++++++++++------------ test/TiffTestCommon.cmake | 5 +++++ 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b9e373f9..731aa806 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -185,6 +185,18 @@ target_link_libraries(custom_dir tiff port) set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output") file(MAKE_DIRECTORY "${TEST_OUTPUT}") +set(tiff_test_extra_args + "-DTIFFCP=$" + "-DTIFFINFO=$" + "-DTIFFSPLIT=$" + "-DLIBTIFF=$") +if(WIN32) + list(APPEND tiff_test_extra_args "-DWIN32=${WIN32}") +endif() +if(CYGWIN) + list(APPEND tiff_test_extra_args "-DCYGWIN=${CYGWIN}") +endif() + macro(tiff_test_convert name command1 command2 command3 infile outfile validate) add_test(NAME "${name}" COMMAND "${CMAKE_COMMAND}" @@ -193,9 +205,8 @@ macro(tiff_test_convert name command1 command2 command3 infile outfile validate) "-DCONVERT_COMMAND3=${command3}" "-DINFILE=${infile}" "-DOUTFILE=${outfile}" - "-DTIFFINFO=$" - "-DLIBTIFF=$" "-DVALIDATE=${validate}" + ${tiff_test_extra_args} -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffTest.cmake") endmacro() @@ -205,8 +216,7 @@ macro(tiff_test_stdout name command infile outfile) "-DSTDOUT_COMMAND=${command}" "-DINFILE=${infile}" "-DOUTFILE=${outfile}" - "-DTIFFINFO=$" - "-DLIBTIFF=$" + ${tiff_test_extra_args} -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffTest.cmake") endmacro() @@ -215,8 +225,7 @@ macro(tiff_test_reader name command infile) COMMAND "${CMAKE_COMMAND}" "-DREADER_COMMAND=${command}" "-DINFILE=${infile}" - "-DTIFFINFO=$" - "-DLIBTIFF=$" + ${tiff_test_extra_args} -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffTest.cmake") endmacro() @@ -344,9 +353,7 @@ add_test(NAME "tiffcp-split" "-DTESTFILES=${ESCAPED_UNCOMPRESSED}" "-DCONJOINED=${TEST_OUTPUT}/tiffcp-split-conjoined.tif" "-DSPLITFILE=${TEST_OUTPUT}/tiffcp-split-split-" - "-DTIFFCP=$" - "-DTIFFSPLIT=$" - "-DLIBTIFF=$" + ${tiff_test_extra_args} -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffSplitTest.cmake") add_test(NAME "tiffcp-split-join" COMMAND "${CMAKE_COMMAND}" @@ -354,9 +361,7 @@ add_test(NAME "tiffcp-split-join" "-DCONJOINED=${TEST_OUTPUT}/tiffcp-split-join-conjoined.tif" "-DSPLITFILE=${TEST_OUTPUT}/tiffcp-split-join-split-" "-DRECONJOINED=${TEST_OUTPUT}/tiffcp-split-join-reconjoined.tif" - "-DTIFFCP=$" - "-DTIFFSPLIT=$" - "-DLIBTIFF=$" + ${tiff_test_extra_args} -P "${CMAKE_CURRENT_SOURCE_DIR}/TiffSplitTest.cmake") # PDF diff --git a/test/TiffTestCommon.cmake b/test/TiffTestCommon.cmake index 50a4c34a..a0db6782 100644 --- a/test/TiffTestCommon.cmake +++ b/test/TiffTestCommon.cmake @@ -101,3 +101,8 @@ if(WIN32) file(TO_NATIVE_PATH "${LIBTIFF_DIR}" LIBTIFF_DIR) set(ENV{PATH} "${LIBTIFF_DIR};$ENV{PATH}") endif() +if(CYGWIN) + get_filename_component(LIBTIFF_DIR "${LIBTIFF}" DIRECTORY) + file(TO_NATIVE_PATH "${LIBTIFF_DIR}" LIBTIFF_DIR) + set(ENV{PATH} "${LIBTIFF_DIR}:$ENV{PATH}") +endif() -- cgit v1.2.1