Tests: update leak config/suppressions

This commit is contained in:
Lovell Fuller
2023-11-24 11:59:29 +00:00
parent 61057f25bc
commit 45ed9ea9bf
2 changed files with 111 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
if ! type valgrind >/dev/null; then
echo "Please install valgrind before running memory leak tests"
@@ -7,14 +8,15 @@ fi
curl -s -o ./test/leak/libvips.supp https://raw.githubusercontent.com/libvips/libvips/master/suppressions/valgrind.supp
for test in ./test/unit/*.js; do
TESTS=$(ls test/unit --ignore=svg.js --ignore=text.js)
for test in $TESTS; do
G_SLICE=always-malloc G_DEBUG=gc-friendly VIPS_LEAK=1 VIPS_NOVECTOR=1 valgrind \
--suppressions=test/leak/libvips.supp \
--suppressions=test/leak/sharp.supp \
--gen-suppressions=yes \
--leak-check=full \
--show-leak-kinds=definite,indirect,possible \
--show-leak-kinds=definite,indirect \
--num-callers=20 \
--trace-children=yes \
node --expose-gc node_modules/.bin/mocha --no-config --slow=60000 --timeout=120000 --require test/beforeEach.js "$test";
node --expose-gc --zero-fill-buffers node_modules/.bin/mocha --no-config --slow=60000 --timeout=120000 --require test/beforeEach.js "test/unit/$test";
done