commit:     7637b1b3de599ab21bfaa9ab42cb1db2db2396b2
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 10 13:11:45 2026 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Jan 10 13:11:45 2026 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7637b1b3

tests: crank up valgrind mode

Allow running for possible leaks too, by ignoring known issues outside
of our scope to fix.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 tests/qatom/dotest                     |  4 ++++
 tests/qlop/dotest                      |  4 ++--
 tests/valgrind-wrapper/qvalgrind       |  4 ++--
 tests/valgrind-wrapper/valgrind.ignore | 29 +++++++++++++++++++++++++++++
 4 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/tests/qatom/dotest b/tests/qatom/dotest
index 8350398..99c6fe2 100755
--- a/tests/qatom/dotest
+++ b/tests/qatom/dotest
@@ -5,6 +5,8 @@
 # test the effects of atom_clone on all our inputs
 export QATOM_CLONE=1
 
+mktmpdir
+
 test() {
        local num=$1 exp=$2 ret=0 out
        shift 2
@@ -98,4 +100,6 @@ test c12 "cat/pkg-123:0/25 == ^cat/pkg-123:0/26" \
 test c13 "cat/pkg-123 != ^cat/pkg-123:0/26" \
        -c 'cat/pkg-123' '^cat/pkg-123:0/26'
 
+cleantmpdir
+
 end

diff --git a/tests/qlop/dotest b/tests/qlop/dotest
index 321f7d2..92dee93 100755
--- a/tests/qlop/dotest
+++ b/tests/qlop/dotest
@@ -11,10 +11,10 @@ test() {
        shift 2
        eval "$@" > list || ret=$?
        if ! diff -u ${as}/list${num}.good list ; then
-               tfail "output does not match"
+               tfail "output does not match for '$*'"
        fi
        if [[ ${exp} -ne ${ret} ]] ; then
-               tfail "exit code (${ret}) does not match expected (${exp})"
+               tfail "exit code (${ret}) does not match expected (${exp}) for 
'$*'"
        fi
        tend $? "$*"
 }

diff --git a/tests/valgrind-wrapper/qvalgrind b/tests/valgrind-wrapper/qvalgrind
index 5286cf6..e1aa806 100755
--- a/tests/valgrind-wrapper/qvalgrind
+++ b/tests/valgrind-wrapper/qvalgrind
@@ -1,6 +1,5 @@
 #!/usr/bin/env bash
 
-# --errors-for-leak-kinds= drop possible due to Solaris libc/_findbuf
 valgrind \
        --leak-check=full \
        --track-fds=yes \
@@ -8,7 +7,8 @@ valgrind \
        --malloc-fill=0xdb \
        --free-fill=0xbd \
        --log-file=q-valgrind.log \
-       --errors-for-leak-kinds=definite \
+       --suppressions=${BASH_SOURCE[0]%/*}/valgrind.ignore \
+       --gen-suppressions=all \
        --error-exitcode=234 \
        "${@}"
 ret=$?

diff --git a/tests/valgrind-wrapper/valgrind.ignore 
b/tests/valgrind-wrapper/valgrind.ignore
new file mode 100644
index 0000000..8291ca1
--- /dev/null
+++ b/tests/valgrind-wrapper/valgrind.ignore
@@ -0,0 +1,29 @@
+# suppressions for known false-positives
+{
+   Solaris_libc_printf_buf
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:_findbuf
+   fun:_ndoprnt
+   fun:printf
+}
+{
+   Solaris_libc_puts_buf
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:_findbuf
+   fun:_wrtchk
+   fun:puts
+}
+{
+   Solaris_libc_fwrite_buf
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:_findbuf
+   fun:_wrtchk
+   fun:_fwrite_unlocked
+   fun:fwrite
+}

Reply via email to