From b10867cdc21ea8b373620d914bffe73681461711 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 7 Feb 2013 08:10:38 -0600 Subject: [PATCH] [libpng17] Enable parallel tests and rearrange TESTS order to take advantage of the massive speed improvements use a make capable of parallel builds on a multi-CPU machine and pass the right arguments to make (-j10000 for GNU make) to get the build to run in parallel. --- ANNOUNCE | 4 ++ CHANGES | 4 ++ Makefile.am | 39 ++++++++++----- configure.ac | 8 ++-- contrib/libtests/pngstest.c | 47 +++++++++++++++---- contrib/libtests/test-pngstest.sh | 24 ---------- contrib/libtests/test-pngunknown.sh | 38 --------------- contrib/libtests/test-pngvalid-full.sh | 21 --------- contrib/libtests/test-pngvalid-simple.sh | 30 ------------ test-pngtest.sh | 16 ------- tests/pngstest-0g01 | 23 +++++++++ tests/pngstest-0g02 | 23 +++++++++ tests/pngstest-0g04 | 23 +++++++++ tests/pngstest-0g08 | 23 +++++++++ tests/pngstest-0g16 | 23 +++++++++ tests/pngstest-2c08 | 23 +++++++++ tests/pngstest-2c16 | 23 +++++++++ tests/pngstest-3p01 | 23 +++++++++ tests/pngstest-3p02 | 23 +++++++++ tests/pngstest-3p04 | 23 +++++++++ tests/pngstest-3p08 | 23 +++++++++ tests/pngstest-4a08 | 23 +++++++++ tests/pngstest-4a16 | 23 +++++++++ tests/pngstest-6a08 | 23 +++++++++ tests/pngstest-6a16 | 23 +++++++++ tests/pngstest-error | 23 +++++++++ tests/pngtest | 2 + tests/pngunknown-IDAT | 2 + tests/pngunknown-discard | 2 + tests/pngunknown-if-safe | 2 + tests/pngunknown-sAPI | 2 + tests/pngunknown-sTER | 2 + tests/pngunknown-save | 2 + tests/pngunknown-vpAg | 2 + tests/pngvalid-gamma-16-to-8 | 2 + tests/pngvalid-gamma-alpha-mode | 2 + tests/pngvalid-gamma-background | 2 + tests/pngvalid-gamma-expand16-alpha-mode | 2 + tests/pngvalid-gamma-expand16-background | 2 + tests/pngvalid-gamma-expand16-transform | 2 + tests/pngvalid-gamma-sbit | 2 + tests/pngvalid-gamma-threshold | 2 + tests/pngvalid-gamma-transform | 2 + tests/pngvalid-progressive-interlace-size | 2 + tests/pngvalid-progressive-interlace-standard | 2 + .../pngvalid-progressive-interlace-transform | 2 + tests/pngvalid-progressive-standard | 2 + tests/pngvalid-standard | 2 + 48 files changed, 492 insertions(+), 151 deletions(-) create mode 100755 tests/pngstest-0g01 create mode 100755 tests/pngstest-0g02 create mode 100755 tests/pngstest-0g04 create mode 100755 tests/pngstest-0g08 create mode 100755 tests/pngstest-0g16 create mode 100755 tests/pngstest-2c08 create mode 100755 tests/pngstest-2c16 create mode 100755 tests/pngstest-3p01 create mode 100755 tests/pngstest-3p02 create mode 100755 tests/pngstest-3p04 create mode 100755 tests/pngstest-3p08 create mode 100755 tests/pngstest-4a08 create mode 100755 tests/pngstest-4a16 create mode 100755 tests/pngstest-6a08 create mode 100755 tests/pngstest-6a16 create mode 100755 tests/pngstest-error create mode 100755 tests/pngtest create mode 100755 tests/pngunknown-IDAT create mode 100755 tests/pngunknown-discard create mode 100755 tests/pngunknown-if-safe create mode 100755 tests/pngunknown-sAPI create mode 100755 tests/pngunknown-sTER create mode 100755 tests/pngunknown-save create mode 100755 tests/pngunknown-vpAg create mode 100755 tests/pngvalid-gamma-16-to-8 create mode 100755 tests/pngvalid-gamma-alpha-mode create mode 100755 tests/pngvalid-gamma-background create mode 100755 tests/pngvalid-gamma-expand16-alpha-mode create mode 100755 tests/pngvalid-gamma-expand16-background create mode 100755 tests/pngvalid-gamma-expand16-transform create mode 100755 tests/pngvalid-gamma-sbit create mode 100755 tests/pngvalid-gamma-threshold create mode 100755 tests/pngvalid-gamma-transform create mode 100755 tests/pngvalid-progressive-interlace-size create mode 100755 tests/pngvalid-progressive-interlace-standard create mode 100755 tests/pngvalid-progressive-interlace-transform create mode 100755 tests/pngvalid-progressive-standard create mode 100755 tests/pngvalid-standard diff --git a/ANNOUNCE b/ANNOUNCE index 2e0a7f5d9..5c547ab65 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -135,6 +135,10 @@ Version 1.7.0alpha10 [February 5, 2013] everywhere. Version 1.7.0alpha11 [February 7, 2013] + Enable parallel tests and rearrange TESTS order to take advantage of + the massive speed improvements use a make capable of parallel builds + on a multi-CPU machine and pass the right arguments to make (-j10000 + for GNU make) to get the build to run in parallel. =========================================================================== NOTICE November 17, 2012: diff --git a/CHANGES b/CHANGES index 0052f20f0..69185e973 100644 --- a/CHANGES +++ b/CHANGES @@ -4421,6 +4421,10 @@ Version 1.7.0alpha10 [February 5, 2013] everywhere. Version 1.7.0alpha11 [February 7, 2013] + Enable parallel tests and rearrange TESTS order to take advantage of + the massive speed improvements use a make capable of parallel builds + on a multi-CPU machine and pass the right arguments to make (-j10000 + for GNU make) to get the build to run in parallel. =========================================================================== NOTICE November 17, 2012: diff --git a/Makefile.am b/Makefile.am index 72417f26a..e2ed796fb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,24 +7,41 @@ PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ ACLOCAL_AMFLAGS = -I scripts # test programs - run on make check, make distcheck -TESTS_ENVIRONMENT= srcdir=$(srcdir) -check_PROGRAMS= pngtest +check_PROGRAMS= pngtest pngunknown pngstest pngvalid + pngtest_SOURCES = pngtest.c pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la -TESTS = test-pngtest.sh -# Only do the following if the contrib directory is present. -check_PROGRAMS+= pngvalid pngstest pngunknown pngvalid_SOURCES = contrib/libtests/pngvalid.c -pngstest_SOURCES = contrib/libtests/pngstest.c -pngunknown_SOURCES = contrib/libtests/pngunknown.c pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngstest_SOURCES = contrib/libtests/pngstest.c pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngunknown_SOURCES = contrib/libtests/pngunknown.c pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la -TESTS += contrib/libtests/test-pngunknown.sh\ - contrib/libtests/test-pngvalid-simple.sh\ - contrib/libtests/test-pngvalid-full.sh\ - contrib/libtests/test-pngstest.sh + +# Generally these are single line shell scripts to run a test with a particular +# set of parameters: +TESTS = tests/pngstest-0g01 tests/pngstest-0g02 tests/pngstest-0g04\ + tests/pngstest-0g08 tests/pngstest-0g16 tests/pngstest-2c08\ + tests/pngstest-2c16 tests/pngstest-3p01 tests/pngstest-3p02\ + tests/pngstest-3p04 tests/pngstest-3p08 tests/pngstest-4a08\ + tests/pngstest-4a16 tests/pngstest-6a08 tests/pngstest-6a16\ + tests/pngstest-error tests/pngtest tests/pngunknown-IDAT\ + tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\ + tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\ + tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\ + tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\ + tests/pngvalid-gamma-expand16-background\ + tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\ + tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\ + tests/pngvalid-progressive-interlace-size\ + tests/pngvalid-progressive-interlace-standard\ + tests/pngvalid-progressive-interlace-transform\ + tests/pngvalid-progressive-standard tests/pngvalid-standard +# These tests are expected, and required, to fail: +XFAIL_TESTS = tests/pngstest-error # man pages dist_man_MANS= libpng.3 libpngpf.3 png.5 diff --git a/configure.ac b/configure.ac index 575e04936..7718acdd7 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,11 @@ AC_CONFIG_MACRO_DIR([scripts]) # silent-rules requires automake 1.11 or later # dist-xz requires automake 1.11 or later # 1.12.2 fixes a security issue in 1.11.2 and 1.12.1 -AM_INIT_AUTOMAKE([1.12.2 foreign dist-xz color-tests silent-rules]) -# was: -# AM_INIT_AUTOMAKE +# 1.13 is required for parallel tests +AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules]) +# The following line causes --disable-maintainer-mode to be the default to +# configure, this is necessary because libpng distributions cannot rely on the +# time stamps of the autotools generated files being correct AM_MAINTAINER_MODE dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c index 71d9a5a9c..a10f3e5e8 100644 --- a/contrib/libtests/pngstest.c +++ b/contrib/libtests/pngstest.c @@ -62,6 +62,12 @@ # define aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ +/* During parallel runs of pngstest each temporary file needs a unique name, + * this is used to permit uniqueness using a command line argument which can be + * up to 22 characters long. + */ +static char tmpf[23] = "TMP"; + /* Generate random bytes. This uses a boring repeatable algorithm and it * is implemented here so that it gives the same set of numbers on every * architecture. It's a linear congruential generator (Knuth or Sedgewick @@ -3198,7 +3204,7 @@ write_one_file(Image *output, Image *image, int convert_to_8bit) static int counter = 0; char name[32]; - sprintf(name, "TMP%d.png", ++counter); + sprintf(name, "%s%d.png", tmpf, ++counter); if (png_image_write_to_file(&image->image, name, convert_to_8bit, image->buffer+16, (png_int_32)image->stride, image->colormap)) @@ -3482,6 +3488,30 @@ main(int argc, char **argv) opts &= ~KEEP_GOING; else if (strcmp(arg, "--strict") == 0) opts |= STRICT; + else if (strcmp(arg, "--tmpfile") == 0) + { + if (c+1 < argc) + { + if (strlen(argv[++c]) >= sizeof tmpf) + { + fflush(stdout); + fprintf(stderr, "%s: %s is too long for a temp file prefix\n", + argv[0], argv[c]); + exit(99); + } + + /* Safe: checked above */ + strcpy(tmpf, argv[c]); + } + + else + { + fflush(stdout); + fprintf(stderr, "%s: %s requires a temporary file prefix\n", + argv[0], arg); + exit(99); + } + } else if (strcmp(arg, "--touch") == 0) { if (c+1 < argc) @@ -3492,7 +3522,7 @@ main(int argc, char **argv) fflush(stdout); fprintf(stderr, "%s: %s requires a file name argument\n", argv[0], arg); - exit(1); + exit(99); } } else if (arg[0] == '+') @@ -3500,7 +3530,7 @@ main(int argc, char **argv) png_uint_32 format = formatof(arg+1); if (format > FORMAT_COUNT) - exit(1); + exit(99); format_set(&formats, format); } @@ -3508,7 +3538,7 @@ main(int argc, char **argv) { fflush(stdout); fprintf(stderr, "%s: unknown option: %s\n", argv[0], arg); - exit(1); + exit(99); } else { @@ -3557,7 +3587,7 @@ main(int argc, char **argv) buffer[4095] = 0; fprintf(stderr, "%s...%s: file name too long\n", buffer, buffer+(4096-32)); - exit(1); + exit(99); } } @@ -3676,7 +3706,7 @@ main(int argc, char **argv) { fflush(stdout); fprintf(stderr, "%s: write failed\n", touch); - exit(1); + exit(99); } } @@ -3684,7 +3714,7 @@ main(int argc, char **argv) { fflush(stdout); fprintf(stderr, "%s: open failed\n", touch); - exit(1); + exit(99); } } @@ -3695,6 +3725,7 @@ main(int argc, char **argv) int main(void) { fprintf(stderr, "pngstest: no read support in libpng, test skipped\n"); - return 0; + /* So the test is skipped: */ + return 77; } #endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ diff --git a/contrib/libtests/test-pngstest.sh b/contrib/libtests/test-pngstest.sh index e977a5b50..e69de29bb 100755 --- a/contrib/libtests/test-pngstest.sh +++ b/contrib/libtests/test-pngstest.sh @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Run the simplified API tests -err=0 - -echo >> pngtest-log.txt -echo "============ pngstest.sh ==============" >> pngtest-log.txt - -echo "Running test-pngstest.sh" -for image in ${srcdir}/contrib/pngsuite/*.png -do - for opts in "" - do - if ./pngstest --strict --log "$@" $opts $image >>pngtest-log.txt 2>&1 - then - echo " PASS: pngstest $opts $image" - else - echo " FAIL: pngstest $opts $image" - err=1 - fi - done -done - -exit $err diff --git a/contrib/libtests/test-pngunknown.sh b/contrib/libtests/test-pngunknown.sh index 1a31864ae..e69de29bb 100755 --- a/contrib/libtests/test-pngunknown.sh +++ b/contrib/libtests/test-pngunknown.sh @@ -1,38 +0,0 @@ -#!/bin/sh -# -# Run the unknown API tests -err=0 -image="${srcdir}/pngtest.png" -# -# stream 4 is used for the output of the shell, pngtest-log.txt gets all the -# normal program output. -exec 4>&1 1>>pngtest-log.txt 2>&1 - -echo -echo "============ test-pngunknown.sh ==============" - -echo "Running test-pngunknown.sh" >&4 - -for tests in \ - "discard default=discard"\ - "save default=save"\ - "if-safe default=if-safe"\ - "vpAg vpAg=if-safe"\ - "sTER sTER=if-safe"\ - "IDAT default=discard IDAT=save"\ - "sAPI bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save" -do - set $tests - test="$1" - shift - - if ./pngunknown "$@" "$image" 4>&- - then - echo " PASS: test-pngunknown $test" >&4 - else - echo " FAIL: test-pngunknown $test" >&4 - err=1 - fi -done - -exit $err diff --git a/contrib/libtests/test-pngvalid-full.sh b/contrib/libtests/test-pngvalid-full.sh index f7d1b2b5d..e69de29bb 100755 --- a/contrib/libtests/test-pngvalid-full.sh +++ b/contrib/libtests/test-pngvalid-full.sh @@ -1,21 +0,0 @@ -#!/bin/sh -# -# Run a sequence of gamma tests quietly -err=0 - -echo >> pngtest-log.txt -echo "============ pngvalid-full.sh ==============" >> pngtest-log.txt - -echo "Running test-pngvalid-full.sh" -for gamma in threshold transform sbit 16-to-8 background alpha-mode "transform --expand16" "background --expand16" "alpha-mode --expand16" -do - if ./pngvalid "$@" --gamma-$gamma >> pngtest-log.txt 2>&1 - then - echo " PASS: pngvalid" "$@" "--gamma-$gamma" - else - echo " FAIL: pngvalid" "$@" "--gamma-$gamma" - err=1 - fi -done - -exit $err diff --git a/contrib/libtests/test-pngvalid-simple.sh b/contrib/libtests/test-pngvalid-simple.sh index 7d4d9d83c..e69de29bb 100755 --- a/contrib/libtests/test-pngvalid-simple.sh +++ b/contrib/libtests/test-pngvalid-simple.sh @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Run a sequence of tests quietly, without the slow -# gamma tests -err=0 - -echo >> pngtest-log.txt -echo "============ pngvalid-simple.sh ==============" >> pngtest-log.txt -echo "Running test-pngvalid-simple.sh" -# The options to test are: -# -# standard tests with and without progressive reading and interlace -# size images with and without progressive reading -# transform tests (standard, non-interlaced only) -# -for opts in "--standard" "--standard --progressive-read" \ - "--standard --interlace" "--standard --progressive-read --interlace" \ - "--size" "--size --progressive-read" \ - "--transform" -do - if ./pngvalid "$@" $opts >> pngtest-log.txt 2>&1 - then - echo " PASS: pngvalid" "$@" $opts - else - echo " FAIL: pngvalid" "$@" $opts - err=1 - fi -done - -exit $err diff --git a/test-pngtest.sh b/test-pngtest.sh index bba128b63..e69de29bb 100755 --- a/test-pngtest.sh +++ b/test-pngtest.sh @@ -1,16 +0,0 @@ -#!/bin/sh - -echo "Running tests. For details see pngtest-log.txt" - -echo "============ pngtest pngtest.png ==============" > pngtest-log.txt - -echo "Running test-pngtest.sh" -if ./pngtest --strict ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1 -then - echo " PASS: pngtest --strict pngtest.png" - err=0 -else - echo " FAIL: pngtest --strict pngtest.png" - err=1 -fi -exit $err diff --git a/tests/pngstest-0g01 b/tests/pngstest-0g01 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-0g01 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-0g02 b/tests/pngstest-0g02 new file mode 100755 index 000000000..fa3940924 --- /dev/null +++ b/tests/pngstest-0g02 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-0g04 b/tests/pngstest-0g04 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-0g04 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-0g08 b/tests/pngstest-0g08 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-0g08 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-0g16 b/tests/pngstest-0g16 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-0g16 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-2c08 b/tests/pngstest-2c08 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-2c08 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-2c16 b/tests/pngstest-2c16 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-2c16 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-3p01 b/tests/pngstest-3p01 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-3p01 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-3p02 b/tests/pngstest-3p02 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-3p02 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-3p04 b/tests/pngstest-3p04 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-3p04 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-3p08 b/tests/pngstest-3p08 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-3p08 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-4a08 b/tests/pngstest-4a08 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-4a08 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-4a16 b/tests/pngstest-4a16 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-4a16 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-6a08 b/tests/pngstest-6a08 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-6a08 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-6a16 b/tests/pngstest-6a16 new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-6a16 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngstest-error b/tests/pngstest-error new file mode 100755 index 000000000..4d8ac8b35 --- /dev/null +++ b/tests/pngstest-error @@ -0,0 +1,23 @@ +#!/bin/sh +# +# The name of the script should be: +# +# pngstest-.... +# +# Where the last four characters are the suffix of a PNGSuite test file, or +# -error, in which case the x files are used. +case "$0" in + */pngstest-????) + suffix="${0##*/pngstest\-}" + exec ./pngstest --tmpfile "error" "${srcdir}/contrib/pngsuite/"[^x]*"${suffix}.png";; + + */pngstest-error) + # Test files may not exist, fake a failure if not + set "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + if test $# -ne 1 -o $1 != "${srcdir}/contrib/pngsuite/x*${suffix}.png" + then + exec ./pngstest --tmpfile "${suffix}" "${srcdir}/contrib/pngsuite/"x*"${suffix}.png" + else + exit 1 + fi;; +esac diff --git a/tests/pngtest b/tests/pngtest new file mode 100755 index 000000000..813973b23 --- /dev/null +++ b/tests/pngtest @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngtest --strict ${srcdir}/pngtest.png diff --git a/tests/pngunknown-IDAT b/tests/pngunknown-IDAT new file mode 100755 index 000000000..71d915a9c --- /dev/null +++ b/tests/pngunknown-IDAT @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown default=discard IDAT=save "${srcdir}/pngtest.png" diff --git a/tests/pngunknown-discard b/tests/pngunknown-discard new file mode 100755 index 000000000..f1f02d4c7 --- /dev/null +++ b/tests/pngunknown-discard @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown default=discard "${srcdir}/pngtest.png" diff --git a/tests/pngunknown-if-safe b/tests/pngunknown-if-safe new file mode 100755 index 000000000..7c52824f8 --- /dev/null +++ b/tests/pngunknown-if-safe @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown default=if-safe "${srcdir}/pngtest.png" diff --git a/tests/pngunknown-sAPI b/tests/pngunknown-sAPI new file mode 100755 index 000000000..e087ef25a --- /dev/null +++ b/tests/pngunknown-sAPI @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save "${srcdir}/pngtest.png" diff --git a/tests/pngunknown-sTER b/tests/pngunknown-sTER new file mode 100755 index 000000000..1b945dc34 --- /dev/null +++ b/tests/pngunknown-sTER @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown sTER=if-safe "${srcdir}/pngtest.png" diff --git a/tests/pngunknown-save b/tests/pngunknown-save new file mode 100755 index 000000000..ae849308c --- /dev/null +++ b/tests/pngunknown-save @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown default=save "${srcdir}/pngtest.png" diff --git a/tests/pngunknown-vpAg b/tests/pngunknown-vpAg new file mode 100755 index 000000000..396c6e40d --- /dev/null +++ b/tests/pngunknown-vpAg @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngunknown vpAg=if-safe "${srcdir}/pngtest.png" diff --git a/tests/pngvalid-gamma-16-to-8 b/tests/pngvalid-gamma-16-to-8 new file mode 100755 index 000000000..b32233829 --- /dev/null +++ b/tests/pngvalid-gamma-16-to-8 @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-16-to-8 diff --git a/tests/pngvalid-gamma-alpha-mode b/tests/pngvalid-gamma-alpha-mode new file mode 100755 index 000000000..ed04fa511 --- /dev/null +++ b/tests/pngvalid-gamma-alpha-mode @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-alpha-mode diff --git a/tests/pngvalid-gamma-background b/tests/pngvalid-gamma-background new file mode 100755 index 000000000..658e5fe4d --- /dev/null +++ b/tests/pngvalid-gamma-background @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-background diff --git a/tests/pngvalid-gamma-expand16-alpha-mode b/tests/pngvalid-gamma-expand16-alpha-mode new file mode 100755 index 000000000..bdda566a0 --- /dev/null +++ b/tests/pngvalid-gamma-expand16-alpha-mode @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-alpha-mode --expand16 diff --git a/tests/pngvalid-gamma-expand16-background b/tests/pngvalid-gamma-expand16-background new file mode 100755 index 000000000..f993c21ae --- /dev/null +++ b/tests/pngvalid-gamma-expand16-background @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-background --expand16 diff --git a/tests/pngvalid-gamma-expand16-transform b/tests/pngvalid-gamma-expand16-transform new file mode 100755 index 000000000..f462534e8 --- /dev/null +++ b/tests/pngvalid-gamma-expand16-transform @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-transform --expand16 diff --git a/tests/pngvalid-gamma-sbit b/tests/pngvalid-gamma-sbit new file mode 100755 index 000000000..aa82fe04f --- /dev/null +++ b/tests/pngvalid-gamma-sbit @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-sbit diff --git a/tests/pngvalid-gamma-threshold b/tests/pngvalid-gamma-threshold new file mode 100755 index 000000000..2cfca9146 --- /dev/null +++ b/tests/pngvalid-gamma-threshold @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-threshold diff --git a/tests/pngvalid-gamma-transform b/tests/pngvalid-gamma-transform new file mode 100755 index 000000000..a71ab4d5e --- /dev/null +++ b/tests/pngvalid-gamma-transform @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --gamma-transform diff --git a/tests/pngvalid-progressive-interlace-size b/tests/pngvalid-progressive-interlace-size new file mode 100755 index 000000000..a31b28355 --- /dev/null +++ b/tests/pngvalid-progressive-interlace-size @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --size --progressive-read diff --git a/tests/pngvalid-progressive-interlace-standard b/tests/pngvalid-progressive-interlace-standard new file mode 100755 index 000000000..59042eb17 --- /dev/null +++ b/tests/pngvalid-progressive-interlace-standard @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --standard --progressive-read --interlace diff --git a/tests/pngvalid-progressive-interlace-transform b/tests/pngvalid-progressive-interlace-transform new file mode 100755 index 000000000..edf9a8a79 --- /dev/null +++ b/tests/pngvalid-progressive-interlace-transform @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --transform diff --git a/tests/pngvalid-progressive-standard b/tests/pngvalid-progressive-standard new file mode 100755 index 000000000..20ecd1583 --- /dev/null +++ b/tests/pngvalid-progressive-standard @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --standard --interlace diff --git a/tests/pngvalid-standard b/tests/pngvalid-standard new file mode 100755 index 000000000..aa1b4b4db --- /dev/null +++ b/tests/pngvalid-standard @@ -0,0 +1,2 @@ +#!/bin/sh +exec ./pngvalid --standard --progressive-read