New test PNG files incorporated into make check

tests/pngstest-* are changed so that the new test files are divided into 8
groups by gamma and alpha channel.  This makes each test take just under 5
seconds on a moderately up-to-date x86_64 system using libpng16 (test times are
somewhat variable under libpng17 at present because of the lack of optimization
in some gamma processing paths.)

These tests have considerably better code and pixel-value coverage than
contrib/pngsuite however coverage is still incomplete.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler 2015-09-25 12:21:10 -07:00
parent 01a0e8062d
commit fa5ba2e026
26 changed files with 64 additions and 59 deletions

View File

@ -55,19 +55,13 @@ TESTS =\
tests/pngvalid-progressive-interlace-standard\
tests/pngvalid-progressive-interlace-transform\
tests/pngvalid-progressive-standard tests/pngvalid-standard\
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/pngunknown-IDAT\
tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\
tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\
tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
tests/pngimage-quick tests/pngimage-full
# These tests are expected, and required, to fail:
XFAIL_TESTS = tests/pngstest-error
# man pages
dist_man_MANS= libpng.3 libpngpf.3 png.5

View File

@ -2,12 +2,51 @@
#
# Usage:
#
# tests/pngstest pattern
# tests/pngstest gamma alpha
#
# Runs pngstest on all the contrib/pngsuite/[^x]*${pattern}.png files
# NOTE: pattern is used to name the temporary files pngstest generates
# Run ./pngstest on the PNG files in $srcdir/contrib/testpngs which have the
# given gamma and opacity:
#
pattern="$1"
# gamma: one of; linear, 1.8, sRGB, none.
# alpha: one of; opaque, tRNS, alpha, none. 'none' is equivalent to !alpha
#
# NOTE: the temporary files pngstest generates have the base name gamma-alpha to
# avoid issues with make -j
#
gamma="$1"
shift
exec ./pngstest --strict --tmpfile "${pattern}" --log ${1+"$@"}\
"${srcdir}/contrib/pngsuite/"[a-wyz]*${pattern}".png"
alpha="$1"
shift
exec ./pngstest --strict --tmpfile "${gamma}-${alpha}-" --log ${1+"$@"} $(
for f in "${srcdir}/contrib/testpngs/"*.png
do
g=
case "$f" in
*-linear[.-]*)
test "$gamma" = "linear" && g="$f";;
*-sRGB[.-]*)
test "$gamma" = "sRGB" && g="$f";;
*-1.8[.-]*)
test "$gamma" = "1.8" && g="$f";;
*)
test "$gamma" = "none" && g="$f";;
esac
case "$g" in
"")
:;;
*-alpha[-.]*)
test "$alpha" = "alpha" && echo "$g";;
*-tRNS[-.]*)
test "$alpha" = "tRNS" -o "$alpha" = "none" && echo "$g";;
*)
test "$alpha" = "opaque" -o "$alpha" = "none" && echo "$g";;
esac
done
)

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 0g01

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 0g02

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 0g04

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 0g08

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 0g16

2
tests/pngstest-1.8 Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 1.8 none

2
tests/pngstest-1.8-alpha Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 1.8 alpha

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 2c08

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 2c16

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 3p01

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 3p02

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 3p04

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 3p08

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 4a08

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 4a16

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 6a08

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" 6a16

View File

@ -1,14 +0,0 @@
#!/bin/sh
code=77 # skipped
for t in "${srcdir}/contrib/pngsuite/"x*".png"
do
if test "$t" != "${srcdir}/contrib/pngsuite/x*.png"
then
# not skipped, test it
if ./pngstest --strict --tmpfile "error" --log "$@" "$t"
then
code=0 # oops, success: should not happen!
fi
fi
done
exit $code

2
tests/pngstest-linear Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" linear none

2
tests/pngstest-linear-alpha Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" linear alpha

2
tests/pngstest-none Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" none none

2
tests/pngstest-none-alpha Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" none alpha

2
tests/pngstest-sRGB Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" sRGB none

2
tests/pngstest-sRGB-alpha Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "${srcdir}/tests/pngstest" sRGB alpha