fix missing -lnetcdff when netcdf built as shared libraries #8
[WPS-merge.git] / external / libpng-1.6.37 / tests / pngstest
blob9d1b7764e56735ca118e7cc4f2eb8db31ca55897
1 #!/bin/sh
3 # Usage:
5 # tests/pngstest gamma alpha
7 # Run ./pngstest on the PNG files in $srcdir/contrib/testpngs which have the
8 # given gamma and opacity:
10 # gamma: one of; linear, 1.8, sRGB, none.
11 # alpha: one of; opaque, tRNS, alpha, none. 'none' is equivalent to !alpha
13 # NOTE: the temporary files pngstest generates have the base name gamma-alpha to
14 # avoid issues with make -j
16 gamma="$1"
17 shift
18 alpha="$1"
19 shift
20 args=
21 LC_ALL="C" # fix glob sort order to ASCII:
22 for f in "${srcdir}/contrib/testpngs/"*.png
25 case "$f" in
26 *-linear[.-]*)
27 test "$gamma" = "linear" && g="$f";;
29 *-sRGB[.-]*)
30 test "$gamma" = "sRGB" && g="$f";;
32 *-1.8[.-]*)
33 test "$gamma" = "1.8" && g="$f";;
36 test "$gamma" = "none" && g="$f";;
37 esac
39 case "$g" in
40 "")
41 :;;
43 *-alpha[-.]*)
44 test "$alpha" = "alpha" && args="$args $g";;
46 *-tRNS[-.]*)
47 test "$alpha" = "tRNS" -o "$alpha" = "none" && args="$args $g";;
50 test "$alpha" = "opaque" -o "$alpha" = "none" && args="$args $g";;
51 esac
52 done
53 # This only works if the arguments don't contain spaces; they don't.
54 exec ./pngstest --tmpfile "${gamma}-${alpha}-" --log ${1+"$@"} $args