From 86dbf5b04397b499380c7fc3ea768a87b930633c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 3 Sep 2013 01:57:43 +0000 Subject: [PATCH] support launching unit tests with valgrind --- tools/run_regression_tests.py | 5 +++-- tools/run_tests.py | 13 +++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/run_regression_tests.py b/tools/run_regression_tests.py index 044e2ea68..4adc864b6 100644 --- a/tools/run_regression_tests.py +++ b/tools/run_regression_tests.py @@ -73,8 +73,9 @@ between all testsers. options: - -j use n parallel processes for running tests - -i build incrementally (i.e. don't clean between checkouts) + -j use n parallel processes for running tests + -i build incrementally (i.e. don't clean between checkouts) + -valgrind run tests with valgrind (requires valgrind to be installed) ''' diff --git a/tools/run_tests.py b/tools/run_tests.py index f058fbd94..baff4db61 100755 --- a/tools/run_tests.py +++ b/tools/run_tests.py @@ -1,3 +1,4 @@ + #!/bin/python # Copyright (c) 2013, Arvid Norberg @@ -157,6 +158,7 @@ options: -j use n parallel processes -h prints this message and exits -i build incrementally (i.e. don't clean between checkouts) +-valgrind run tests with valgrind (requires valgrind to be installed) ''' def main(argv): @@ -166,6 +168,11 @@ def main(argv): num_processes = 4 incremental = False + test_dirs = [] + configs = [] + options = ['boost=source'] + time_limit = 1200 + for arg in argv: if arg[0] == '-': if arg[1] == 'j': @@ -175,6 +182,8 @@ def main(argv): sys.exit(1) elif arg[1] == 'i': incremental = True + elif arg[1:] == 'valgrind': + options.append('launcher=valgrind') else: print 'unknown option: %s' % arg print_usage() @@ -194,10 +203,6 @@ def main(argv): cfg = yaml.load(cfg.read()) - test_dirs = [] - configs = [] - options = ['boost=source'] - time_limit = 1200 if 'test_dirs' in cfg: for d in cfg['test_dirs']: test_dirs.append(d)