summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2016-01-28 23:10:04 -0800
committerJohn Bowler <jbowler@acm.org>2016-01-28 23:10:04 -0800
commite717842a54c2b2d7f9f9a512327a2c7c845adc52 (patch)
tree453446f37f537e849fbb680922044de8f5c17ddd /tests
parent74e481c74355c55a6a0a86b27d224e2f5c2030ec (diff)
downloadlibpng-e717842a54c2b2d7f9f9a512327a2c7c845adc52.tar.gz
pngstest: options to fix per-file seed
Also avoid command output substition in tests/pngstest and fix the collation locale to ASCII/C/POSIX Signed-off-by: John Bowler <jbowler@acm.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/pngstest54
1 files changed, 28 insertions, 26 deletions
diff --git a/tests/pngstest b/tests/pngstest
index 0400b073f..9d1b7764e 100755
--- a/tests/pngstest
+++ b/tests/pngstest
@@ -17,36 +17,38 @@ gamma="$1"
shift
alpha="$1"
shift
-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";;
+args=
+LC_ALL="C" # fix glob sort order to ASCII:
+for f in "${srcdir}/contrib/testpngs/"*.png
+do
+ g=
+ case "$f" in
+ *-linear[.-]*)
+ test "$gamma" = "linear" && g="$f";;
- *-sRGB[.-]*)
- test "$gamma" = "sRGB" && g="$f";;
+ *-sRGB[.-]*)
+ test "$gamma" = "sRGB" && g="$f";;
- *-1.8[.-]*)
- test "$gamma" = "1.8" && g="$f";;
+ *-1.8[.-]*)
+ test "$gamma" = "1.8" && g="$f";;
- *)
- test "$gamma" = "none" && g="$f";;
- esac
+ *)
+ test "$gamma" = "none" && g="$f";;
+ esac
- case "$g" in
- "")
- :;;
+ case "$g" in
+ "")
+ :;;
- *-alpha[-.]*)
- test "$alpha" = "alpha" && echo "$g";;
+ *-alpha[-.]*)
+ test "$alpha" = "alpha" && args="$args $g";;
- *-tRNS[-.]*)
- test "$alpha" = "tRNS" -o "$alpha" = "none" && echo "$g";;
+ *-tRNS[-.]*)
+ test "$alpha" = "tRNS" -o "$alpha" = "none" && args="$args $g";;
- *)
- test "$alpha" = "opaque" -o "$alpha" = "none" && echo "$g";;
- esac
- done
-`
+ *)
+ test "$alpha" = "opaque" -o "$alpha" = "none" && args="$args $g";;
+ esac
+done
+# This only works if the arguments don't contain spaces; they don't.
+exec ./pngstest --tmpfile "${gamma}-${alpha}-" --log ${1+"$@"} $args