X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fpngstest;h=0400b073fe26cd14c167e5eb4dd39345662f69fc;hb=2d1355de64d49bee7cd60ad6a069b33c3a91400c;hp=f5cbdbcae4379053d143221db2d19b2f9c4a1df7;hpb=361fb099aa967c1618d8071268abab395e67e86a;p=platform%2Fupstream%2Flibpng.git diff --git a/tests/pngstest b/tests/pngstest index f5cbdbc..0400b07 100755 --- a/tests/pngstest +++ b/tests/pngstest @@ -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 +alpha="$1" shift -exec ./pngstest --strict --tmpfile "${pattern}" --log ${1+"$@"}\ - "${srcdir}/contrib/pngsuite/"[a-wyz]*${pattern}".png" +exec ./pngstest --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 +`