filter() {
perl -e '
while (<>) {
if (/ at 0x/) {
print $_ if /stakker/;
while (<>) {
last unless / by 0x/;
if (/stakker/) {
print $_;
}
}
print $_;
} else {
print $_;
}
}'
}
cat >tmp-valgrind-suppressions.txt <<EOF
{
uninteresting statx problem
Memcheck:Param
statx(file_name)
fun:syscall
fun:statx
fun:_ZN3std3sys4unix2fs9try_statx*
fun:_ZN3std3sys4unix2fs4stat*
}
{
uninteresting statx problem
Memcheck:Param
statx(buf)
fun:syscall
fun:statx
fun:_ZN3std3sys4unix2fs9try_statx*
fun:_ZN3std3sys4unix2fs4stat*
}
EOF
./run-feature-combinations | while read FEATURES
do
echo === $FEATURES
cargo test --lib $FEATURES >/dev/null 2>&1 || {
cargo test --lib $FEATURES 2>&1
echo FAILED
exit 1
}
valgrind \
--tool=memcheck \
--trace-children=yes \
--leak-check=full \
--suppressions=tmp-valgrind-suppressions.txt \
--show-leak-kinds=definite \
--undef-value-errors=no \
cargo test --lib $FEATURES 2>&1 | filter
done 2>&1 | tee tmp-valgrind.log
rm tmp-valgrind-suppressions.txt
echo ""
echo "SUMMARY: (see tmp-valgrind.log for details)"
fgrep definitely tmp-valgrind.log