Skip to content

Commit

Permalink
tools: Add infrastructure to make it easier to run valgrind (envoypro…
Browse files Browse the repository at this point in the history
…xy#3227)

Signed-off-by: Joshua Marantz <[email protected]>
  • Loading branch information
jmarantz authored and mattklein123 committed Apr 26, 2018
1 parent c02bc5b commit ef40929
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/run-valgrind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
#
# Helper script to run tests under valgrind. Usage:
# bazel test --run_under=`pwd`/tools/run-valgrind.sh ...
#

dir=$(dirname "$0")

# In order to add suppressions, it's helpful to run the tool in a mode
# where it uses the suppressions file we have so far, but also
# generates possible new suppressions in the test output, so you can
# paste them into the suppressions file.
#yes | exec valgrind --gen-suppressions=yes --suppressions="$dir/valgrind-suppressions.txt" "$@"

# Ordinarily, we run with cleaner output.
exec valgrind --gen-suppressions=yes --suppressions="$dir/valgrind-suppressions.txt" "$@"
6 changes: 6 additions & 0 deletions tools/valgrind-suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
eliminate new/free mismatch warnings altogether, as something in the current toolchain generates this scenario.
Memcheck:Free
fun:free
...
}

0 comments on commit ef40929

Please sign in to comment.