libvips/test/variables.sh.in

61 lines
1.3 KiB
Bash
Raw Normal View History

top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
PYTHON=@PYTHON@
2014-12-20 23:25:19 +01:00
# we need a different tmp for each script since make can run tests in parallel
Revised threading system (#3105) * reimplement threadpool just a set of threads that get recycled "ninja test" passes and dzsave seems to work, though pytest fails for some reason * clean up threading code a bit move base stuff into thread.c, so we have a simple thread -> threadset -> threadpool layering * start trying to revert g_threadpool based on the original commit * working! nice low systime again still need to repply cnages to threadpool.c since 80e0cc3d1 * reapply fixes from master so threadpool.c is now up to date * rename VipsThread as VipsWorker a bit less confusing * use a semaphore to count workers in a pool * tidy up * formatting * dynamic threadpool sizing based on counting the number of blocked threads in each pool it works, but the improvement is not great :( * add "concurrency" metadata item so operators can hint threadpool size (dzsave especially) * don't use thinstrip for small images * add RGB mode to openslide since flatten was taking 20% of CPU time for dzsave * fix up rgb mode now actually works * make the tile buffer per thread in the new openslideload rgb mode * fix dynamic pool downsize * mild refactoring * fix the buffer system oops, turned it off by mistake * all done! * revise changelog * Update libvips/iofuncs/threadset.c Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl> * Update libvips/iofuncs/threadset.c Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl> * LSan: add libMagickCore to suppression file * Revert "Remove mutex lock for VipsThreadStartFn" This reverts commit 41440491. * add VIPS_MAX_THREADS to set a hard limit on the threadset size * Revert "Revert "Remove mutex lock for VipsThreadStartFn"" This reverts commit 77e8520966ba79194fff3b4e648bbd295cd5c260. * remove sslock from sink.c * move fixed threadpool build to init not first use * add some doc comments * revert test suite threshold change * add a test for MAX_THREADS and move the test tmp/ area into the builddir * limit VIPS_MAX_THREADS to sane values * use tabs rather than spaces Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
2022-10-26 16:25:19 +02:00
tmp=$top_builddir/test/tmp-$$
test_images=$top_srcdir/test/test-suite/images
image=$test_images/sample.jpg
2014-11-19 18:32:29 +01:00
mkdir -p $tmp
vips=$top_builddir/tools/vips
vipsthumbnail=$top_builddir/tools/vipsthumbnail
vipsheader=$top_builddir/tools/vipsheader
# we need bc to use '.' for a decimal separator
export LC_NUMERIC=C
2019-10-06 11:55:19 +02:00
# raspbian sets this too, annoyingly
unset LC_ALL
2019-10-06 11:55:19 +02:00
# test for file format supported
test_supported() {
format=$1
if $vips $format > /dev/null 2>&1; then
result=0
else
echo "support for $format not configured, skipping test"
result=1
fi
return $result
}
# is a difference beyond a threshold? return 0 (meaning all ok) or 1 (meaning
# error, or outside threshold)
#
# use bc since bash does not support fp math
break_threshold() {
diff=$1
threshold=$2
if ! command -v bc >/dev/null; then
exit 77
fi
return $(echo "$diff <= $threshold" | bc -l)
}
# subtract, look for max difference less than a threshold
test_difference() {
before=$1
after=$2
threshold=$3
$vips subtract $before $after $tmp/difference.v
$vips abs $tmp/difference.v $tmp/abs.v
dif=$($vips max $tmp/abs.v)
if break_threshold $dif $threshold; then
echo "save / load difference is $dif"
exit 1
fi
}