echo "(This intentionally leaks some memory in order to measure it)"
echo ""
for xx in \
"" \
"--features no-unsafe" \
"--all-features"
do
echo "=== Testing: $xx"
cargo test --lib test::memsizes::actor_size $xx 2>&1
STAKKER_ENABLE_TEST_MEMSIZES=1 \
valgrind \
--tool=memcheck \
--trace-children=yes \
--leak-check=full \
--show-leak-kinds=definite,indirect \
--undef-value-errors=no \
cargo test --lib test::memsizes::actor_size $xx 2>&1 |
perl -e '
while (<>) {
if (/ indirectly lost /) {
print $_;
while (<>) {
last unless /by |at /;
if (/stakker/) {
print $_;
while (<>) {
last unless /stakker/;
last if /test/;
print $_;
}
last;
}
}
}
}'
done