improvements to test to help osx

This commit is contained in:
John Cupitt 2014-12-20 16:17:44 +00:00
parent da007b22e6
commit 932a16b615
6 changed files with 25 additions and 20 deletions

View File

@ -7,8 +7,10 @@ EXTRA_DIST = \
test_seq.sh \ test_seq.sh \
test_thumbnail.sh \ test_thumbnail.sh \
test_threading.sh \ test_threading.sh \
test_python.sh
test_arithmetic.py \ test_arithmetic.py \
test_colour.py \ test_colour.py \
test_convolution.py \
test_conversion.py test_conversion.py
# don't run test_thumbnail.sh by default, it takes ages # don't run test_thumbnail.sh by default, it takes ages
@ -19,8 +21,7 @@ TESTS = \
test_cli.sh \ test_cli.sh \
test_formats.sh \ test_formats.sh \
test_seq.sh \ test_seq.sh \
test_threading.sh \ test_threading.sh
test_python.sh
clean-local: clean-local:
-rm -rf tmp -rm -rf tmp

View File

@ -34,7 +34,7 @@ test_rotate() {
im=$1 im=$1
inter=$2 inter=$2
echo -n "testing $inter ... " printf "testing $inter ... "
# 90 degree clockwise rotate # 90 degree clockwise rotate
trn="0 1 1 0" trn="0 1 1 0"

View File

@ -70,7 +70,7 @@ test_format() {
threshold=$3 threshold=$3
mode=$4 mode=$4
echo -n "testing $(basename $in) $format$mode ... " printf "testing $(basename $in) $format$mode ... "
save_load $in $format $mode save_load $in $format $mode
test_difference $in $tmp/back.v $threshold test_difference $in $tmp/back.v $threshold
@ -84,7 +84,7 @@ test_format() {
test_rad() { test_rad() {
in=$1 in=$1
echo -n "testing $(basename $in) hdr ... " printf "testing $(basename $in) hdr ... "
save_load $in hdr save_load $in hdr
@ -101,7 +101,7 @@ test_rad() {
test_raw() { test_raw() {
in=$1 in=$1
echo -n "testing $(basename $in) raw ... " printf "testing $(basename $in) raw ... "
vips copy $in $tmp/before.v vips copy $in $tmp/before.v
width=$(vipsheader -f width $tmp/before.v) width=$(vipsheader -f width $tmp/before.v)
@ -123,7 +123,7 @@ test_loader() {
in=$2 in=$2
format=$3 format=$3
echo -n "testing $(basename $in) $format ... " printf "testing $(basename $in) $format ... "
vips copy $ref $tmp/before.v vips copy $ref $tmp/before.v
vips copy $in $tmp/after.v vips copy $in $tmp/after.v
@ -135,14 +135,14 @@ test_loader() {
test_format $image v 0 test_format $image v 0
test_format $image tif 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=deflate]
test_format $image tif 0 [compression=packbits] test_format $image tif 0 [compression=packbits]
test_format $image tif 70 [compression=jpeg,tile] test_format $image tif 90 [compression=jpeg,tile]
test_format $image tif 70 [compression=jpeg,tile,pyramid] test_format $image tif 90 [compression=jpeg,tile,pyramid]
test_format $image png 0 test_format $image png 0
test_format $image png 0 [compression=9,interlace=1] 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 ppm 0
test_format $image pfm 0 test_format $image pfm 0
test_format $image fits 0 test_format $image fits 0
@ -151,11 +151,11 @@ test_format $image fits 0
test_format $mono csv 0 test_format $mono csv 0
# cmyk jpg is a special path # 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 0
test_format $cmyk tif 70 [compression=jpeg] test_format $cmyk tif 90 [compression=jpeg]
test_format $cmyk tif 70 [compression=jpeg,tile] test_format $cmyk tif 90 [compression=jpeg,tile]
test_format $cmyk tif 70 [compression=jpeg,tile,pyramid] test_format $cmyk tif 90 [compression=jpeg,tile,pyramid]
test_rad $rad test_rad $rad

View File

@ -2,6 +2,10 @@
# set -x # 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 . ./variables.sh
echo "testing with python2 ..." echo "testing with python2 ..."

View File

@ -5,13 +5,13 @@
. ./variables.sh . ./variables.sh
# make a large PNG, roughly the size of Chicago.png # 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 vips replicate $image $tmp/huge.png 30 5
echo "ok" echo "ok"
huge=$tmp/huge.png huge=$tmp/huge.png
echo -n "testing vipsthumbnail ... " printf "testing vipsthumbnail ... "
rm -f $tmp/x.png rm -f $tmp/x.png
vipsthumbnail $huge -o $tmp/x.png vipsthumbnail $huge -o $tmp/x.png
if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then
@ -26,7 +26,7 @@ if [ ! -d $tmp/readonly ] ; then
fi fi
export TMPDIR=$tmp/readonly export TMPDIR=$tmp/readonly
echo -n "testing vipsthumbnail does not make temps ... " printf "testing vipsthumbnail does not make temps ... "
rm -f $tmp/x.png rm -f $tmp/x.png
vipsthumbnail $huge -o $tmp/x.png vipsthumbnail $huge -o $tmp/x.png
if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then 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 fi
echo "ok" echo "ok"
echo -n "testing shrink does not make temps ... " printf "testing shrink does not make temps ... "
rm -f $tmp/x.png rm -f $tmp/x.png
vips shrink $huge $tmp/x.png 230 230 vips shrink $huge $tmp/x.png 230 230
if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then if ! vipsheader $tmp/x.png > /dev/null 2>&1 ; then

View File

@ -26,7 +26,7 @@ break_threshold() {
for interp in nearest bilinear bicubic lbb nohalo vsqbs; do for interp in nearest bilinear bicubic lbb nohalo vsqbs; do
size=1000 size=1000
while [ $size -gt 499 ]; do 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 vipsthumbnail $tmp/t1.v -o $tmp/t2.v --size $size --interpolator $interp
if [ $(vipsheader -f width $tmp/t2.v) -ne $size ]; then if [ $(vipsheader -f width $tmp/t2.v) -ne $size ]; then
echo failed -- bad size echo failed -- bad size