group.add_option("", "--vg", dest="useValgrind",
help="Run tests under valgrind",
action="store_true", default=False)
+ group.add_option("", "--vg-arg", dest="valgrindArgs",
+ help="Specify an extra argument for valgrind",
+ type=str, action="append", default=[])
group.add_option("", "--time-tests", dest="timeTests",
help="Track elapsed wall time for each test",
action="store_true", default=False)
cfg.clang = opts.clang
cfg.clangcc = opts.clangcc
cfg.useValgrind = opts.useValgrind
+ cfg.valgrindArgs = opts.valgrindArgs
cfg.useExternalShell = opts.useExternalShell
# FIXME: It could be worth loading these in parallel with testing.
if cfg.useValgrind:
# FIXME: Running valgrind on sh is overkill. We probably could just
# run on clang with no real loss.
- command = ['valgrind', '-q',
- '--tool=memcheck', '--leak-check=no', '--trace-children=yes',
- '--error-exitcode=123'] + command
+ valgrindArgs = ['valgrind', '-q',
+ '--tool=memcheck', '--trace-children=yes',
+ '--error-exitcode=123'] + cfg.valgrindArgs
+ command = valgrindArgs + command
p = subprocess.Popen(command, cwd=cwd,
stdin=subprocess.PIPE,