mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
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:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user