Tests: Move all setup to named file

This commit is contained in:
Lovell Fuller 2018-09-22 13:54:20 +01:00
parent 2ce166ab0a
commit 24b42ef192
3 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@ if ! type valgrind >/dev/null; then
exit 1
fi
curl -o ./test/leak/libvips.supp https://raw.githubusercontent.com/libvips/libvips/master/libvips.supp
curl -s -o ./test/leak/libvips.supp https://raw.githubusercontent.com/libvips/libvips/master/libvips.supp
for test in ./test/unit/*.js; do
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind \
@ -16,5 +16,5 @@ for test in ./test/unit/*.js; do
--show-leak-kinds=definite,indirect,possible \
--num-callers=20 \
--trace-children=yes \
mocha --slow=60000 --timeout=120000 "$test";
node node_modules/.bin/mocha --slow=60000 --timeout=120000 --file test/unit/beforeEach.js "$test";
done

View File

@ -233,7 +233,13 @@
...
fun:uv__work_done
}
{
leak_libuv_FlushForegroundTasks
Memcheck:Leak
match-leak-kinds: possible
...
fun:_ZN4node12NodePlatform28FlushForegroundTasksInternalEv
}
# nodejs warnings
{
param_nodejs_write_buffer

View File

@ -4,7 +4,9 @@ const detectLibc = require('detect-libc');
const sharp = require('../../');
const usingCache = detectLibc.family !== detectLibc.MUSL;
const usingSimd = !process.env.G_DEBUG;
beforeEach(function () {
sharp.cache(usingCache);
sharp.simd(usingSimd);
});