-
Notifications
You must be signed in to change notification settings - Fork 8
/
run-measure-sizes
executable file
·45 lines (40 loc) · 1.13 KB
/
run-measure-sizes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
echo "(This intentionally leaks some memory in order to measure it)"
echo ""
for xx in \
"" \
"--features no-unsafe" \
"--all-features"
do
echo "=== Testing: $xx"
# Run cargo test twice. First builds and tests. Second skips the
# build (already done) and just runs the test under valgrind. We only
# want to valgrind the test, not building-related stuff.
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