From 171bc40afd48bd2159fc4ddcf209a1ced2405618 Mon Sep 17 00:00:00 2001 From: clanmills Date: Thu, 16 Apr 2020 08:28:09 +0100 Subject: [PATCH] Run a reduced test suite on Unix platforms. --- CMakeLists.txt | 8 +++++++- test/Makefile | 51 +++++++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 219f82d0..70caa104 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,11 +82,17 @@ if( EXIV2_BUILD_UNIT_TESTS ) add_subdirectory ( unitTests ) endif() +# Run a reduced test suite on UNIX #902 +set (TEST test) +if ( CMAKE_HOST_SOLARIS OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) + set (TEST unixtest) +endif() + if( EXIV2_BUILD_SAMPLES ) ## # tests add_custom_target(tests - COMMAND env EXIV2_BINDIR="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" make test + COMMAND env EXIV2_BINDIR="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" make ${TEST} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test" ) add_subdirectory( samples ) diff --git a/test/Makefile b/test/Makefile index c65df3da..8fd04923 100644 --- a/test/Makefile +++ b/test/Makefile @@ -59,7 +59,7 @@ SHELL = /bin/sh # to save download time for simple build/test, we download video and eps data on demand SVN = svn://dev.exiv2.org/svn/testdata/trunk -# ## +# ## Sadly on SunOS make terminates saying "unexpected end of line" # # determine the test platform # UNAME := $(shell uname) # UNIX=FALSE @@ -72,7 +72,7 @@ SVN = svn://dev.exiv2.org/svn/testdata/trunk ## # Add test drivers to this list -TESTS = addmoddel.sh \ +TESTS1 = addmoddel.sh \ conversions.sh \ geotag-test.sh \ icc-test.sh \ @@ -83,21 +83,18 @@ TESTS = addmoddel.sh \ webp-test.sh \ write2-test.sh \ -# # the following tests are broken on UNIX -# ifeq ($(UNIX),FALSE) -# TESTS += exifdata-test.sh \ -# exiv2-test.sh \ -# imagetest.sh \ -# iotest.sh \ -# iptctest.sh \ -# preview-test.sh \ -# tiff-test.sh \ -# write-test.sh \ -# xmpparser-test.sh -# endif - -# always run version-test.sh last! -TESTS += version-test.sh +# the following tests are broken on UNIX +# You can manually run all the tests: `cd /test ; env EXIV2_BINDIR=$PWD/../build/bin make test` +# You can manually run a single test: `cd /test ; env EXIV2_BINDIR=$PWD/../build/bin ./iotest.sh` +TESTS2 = exifdata-test.sh \ + exiv2-test.sh \ + imagetest.sh \ + iotest.sh \ + iptctest.sh \ + preview-test.sh \ + tiff-test.sh \ + write-test.sh \ + xmpparser-test.sh # video tests TESTV = video-test.sh @@ -115,10 +112,26 @@ TESTX = httpiotest.sh \ tests: cd .. ; make tests +unixtests: + cd .. ; make unixtests + test: mkdir -p tmp - rm -rf tmp/test-failed - @list='$(TESTS)'; for p in $$list; do \ + @rm -rf tmp/test-failed + @list='$(TESTS1) $(TESTS2) version-test.sh'; for p in $$list; do \ + echo Running $$p ...; \ + ./$$p; \ + rc=$$?; \ + if [ $$rc -ne 0 ]; then echo '***' ; echo '***' $$p result = $$rc ; echo '***' ; fi ; \ + if [ $$rc -ne 0 ]; then echo '***' $$p result = $$rc >> tmp/test-failed ; fi ; \ + done + make newtests + @if [ -e tmp/test-failed ]; then echo '***' FAILED ; cat tmp/test-failed ; echo '***' ; exit 255; fi + +unixtest: + mkdir -p tmp + @rm -rf tmp/test-failed + @list='$(TESTS1) version-test.sh'; for p in $$list; do \ echo Running $$p ...; \ ./$$p; \ rc=$$?; \