summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-06-08 20:46:10 +0000
committerEven Rouault <even.rouault@spatialys.com>2017-06-08 20:46:10 +0000
commitf2a3b020402943f90957552a884788e70ece6cd7 (patch)
tree831f0e0411bd929ba413f8555604dc4f0b5e3695 /test
parent1d658302f8789dbcef153ff610a1e5ecb9230c8d (diff)
downloadlibtiff-git-f2a3b020402943f90957552a884788e70ece6cd7.tar.gz
* .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.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt29
-rw-r--r--test/TiffTestCommon.cmake5
2 files changed, 22 insertions, 12 deletions
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=$<TARGET_FILE:tiffcp>"
+ "-DTIFFINFO=$<TARGET_FILE:tiffinfo>"
+ "-DTIFFSPLIT=$<TARGET_FILE:tiffsplit>"
+ "-DLIBTIFF=$<TARGET_FILE:tiff>")
+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=$<TARGET_FILE:tiffinfo>"
- "-DLIBTIFF=$<TARGET_FILE:tiff>"
"-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=$<TARGET_FILE:tiffinfo>"
- "-DLIBTIFF=$<TARGET_FILE:tiff>"
+ ${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=$<TARGET_FILE:tiffinfo>"
- "-DLIBTIFF=$<TARGET_FILE:tiff>"
+ ${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=$<TARGET_FILE:tiffcp>"
- "-DTIFFSPLIT=$<TARGET_FILE:tiffsplit>"
- "-DLIBTIFF=$<TARGET_FILE:tiff>"
+ ${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=$<TARGET_FILE:tiffcp>"
- "-DTIFFSPLIT=$<TARGET_FILE:tiffsplit>"
- "-DLIBTIFF=$<TARGET_FILE:tiff>"
+ ${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()