From 932a16b615da006238a8775be671389d498f2656 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 20 Dec 2014 16:17:44 +0000 Subject: [PATCH] improvements to test to help osx --- test/Makefile.am | 5 +++-- test/test_cli.sh | 2 +- test/test_formats.sh | 24 ++++++++++++------------ test/test_python.sh | 4 ++++ test/test_seq.sh | 8 ++++---- test/test_thumbnail.sh | 2 +- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 3642ba64..dbe8540c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -7,8 +7,10 @@ EXTRA_DIST = \ test_seq.sh \ test_thumbnail.sh \ test_threading.sh \ + test_python.sh test_arithmetic.py \ test_colour.py \ + test_convolution.py \ test_conversion.py # don't run test_thumbnail.sh by default, it takes ages @@ -19,8 +21,7 @@ TESTS = \ test_cli.sh \ test_formats.sh \ test_seq.sh \ - test_threading.sh \ - test_python.sh + test_threading.sh clean-local: -rm -rf tmp diff --git a/test/test_cli.sh b/test/test_cli.sh index 0eed7c75..720aa421 100755 --- a/test/test_cli.sh +++ b/test/test_cli.sh @@ -34,7 +34,7 @@ test_rotate() { im=$1 inter=$2 - echo -n "testing $inter ... " + printf "testing $inter ... " # 90 degree clockwise rotate trn="0 1 1 0" diff --git a/test/test_formats.sh b/test/test_formats.sh index e5d8f488..f921087e 100755 --- a/test/test_formats.sh +++ b/test/test_formats.sh @@ -70,7 +70,7 @@ test_format() { threshold=$3 mode=$4 - echo -n "testing $(basename $in) $format$mode ... " + printf "testing $(basename $in) $format$mode ... " save_load $in $format $mode test_difference $in $tmp/back.v $threshold @@ -84,7 +84,7 @@ test_format() { test_rad() { in=$1 - echo -n "testing $(basename $in) hdr ... " + printf "testing $(basename $in) hdr ... " save_load $in hdr @@ -101,7 +101,7 @@ test_rad() { test_raw() { in=$1 - echo -n "testing $(basename $in) raw ... " + printf "testing $(basename $in) raw ... " vips copy $in $tmp/before.v width=$(vipsheader -f width $tmp/before.v) @@ -123,7 +123,7 @@ test_loader() { in=$2 format=$3 - echo -n "testing $(basename $in) $format ... " + printf "testing $(basename $in) $format ... " vips copy $ref $tmp/before.v vips copy $in $tmp/after.v @@ -135,14 +135,14 @@ test_loader() { test_format $image v 0 test_format $image tif 0 -test_format $image tif 70 [compression=jpeg] +test_format $image tif 90 [compression=jpeg] test_format $image tif 0 [compression=deflate] test_format $image tif 0 [compression=packbits] -test_format $image tif 70 [compression=jpeg,tile] -test_format $image tif 70 [compression=jpeg,tile,pyramid] +test_format $image tif 90 [compression=jpeg,tile] +test_format $image tif 90 [compression=jpeg,tile,pyramid] test_format $image png 0 test_format $image png 0 [compression=9,interlace=1] -test_format $image jpg 70 +test_format $image jpg 90 test_format $image ppm 0 test_format $image pfm 0 test_format $image fits 0 @@ -151,11 +151,11 @@ test_format $image fits 0 test_format $mono csv 0 # cmyk jpg is a special path -test_format $cmyk jpg 70 +test_format $cmyk jpg 90 test_format $cmyk tif 0 -test_format $cmyk tif 70 [compression=jpeg] -test_format $cmyk tif 70 [compression=jpeg,tile] -test_format $cmyk tif 70 [compression=jpeg,tile,pyramid] +test_format $cmyk tif 90 [compression=jpeg] +test_format $cmyk tif 90 [compression=jpeg,tile] +test_format $cmyk tif 90 [compression=jpeg,tile,pyramid] test_rad $rad diff --git a/test/test_python.sh b/test/test_python.sh index c7518503..6371ef6a 100755 --- a/test/test_python.sh +++ b/test/test_python.sh @@ -2,6 +2,10 @@ # set -x +# don't run this set of tests as part of make check -- some platforms do make +# check before install and it's too hard to make pyvips8 work without +# installation + . ./variables.sh echo "testing with python2 ..." diff --git a/test/test_seq.sh b/test/test_seq.sh index 3023685d..9819a0f2 100755 --- a/test/test_seq.sh +++ b/test/test_seq.sh @@ -5,13 +5,13 @@ . ./variables.sh # make a large PNG, roughly the size of Chicago.png -echo -n "building huge test PNG image ... " +printf "building huge test PNG image ... " vips replicate $image $tmp/huge.png 30 5 echo "ok" huge=$tmp/huge.png -echo -n "testing vipsthumbnail ... " +printf "testing vipsthumbnail ... " rm -f $tmp/x.png vipsthumbnail $huge -o $tmp/x.png if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then @@ -26,7 +26,7 @@ if [ ! -d $tmp/readonly ] ; then fi export TMPDIR=$tmp/readonly -echo -n "testing vipsthumbnail does not make temps ... " +printf "testing vipsthumbnail does not make temps ... " rm -f $tmp/x.png vipsthumbnail $huge -o $tmp/x.png if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then @@ -35,7 +35,7 @@ if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then fi echo "ok" -echo -n "testing shrink does not make temps ... " +printf "testing shrink does not make temps ... " rm -f $tmp/x.png vips shrink $huge $tmp/x.png 230 230 if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then diff --git a/test/test_thumbnail.sh b/test/test_thumbnail.sh index 2d88f20a..cccdcffc 100755 --- a/test/test_thumbnail.sh +++ b/test/test_thumbnail.sh @@ -26,7 +26,7 @@ break_threshold() { for interp in nearest bilinear bicubic lbb nohalo vsqbs; do size=1000 while [ $size -gt 499 ]; do - echo -n "testing $interp, size to $size ... " + printf "testing $interp, size to $size ... " vipsthumbnail $tmp/t1.v -o $tmp/t2.v --size $size --interpolator $interp if [ $(vipsheader -f width $tmp/t2.v) -ne $size ]; then echo failed -- bad size