diff options
author | David Robillard <d@drobilla.net> | 2011-01-20 18:58:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-20 18:58:05 +0000 |
commit | b6ed3687232d4b4868f73d392aa7a5203a8e96f7 (patch) | |
tree | 4532a70d384e4f4bcb550c9abaf90bd9a79d5bfc | |
parent | 012704dc8ac981a95c1a0efaa92629d43e9a9dcb (diff) | |
download | autowaf-b6ed3687232d4b4868f73d392aa7a5203a8e96f7.tar.gz autowaf-b6ed3687232d4b4868f73d392aa7a5203a8e96f7.tar.bz2 autowaf-b6ed3687232d4b4868f73d392aa7a5203a8e96f7.zip |
Add option to run tests in valgrind.
git-svn-id: http://svn.drobilla.net/autowaf@25 e2e4594f-ea7b-45dc-bc5a-5f5301e603aa
-rw-r--r-- | autowaf.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -40,6 +40,8 @@ def set_options(opt): opt.tool_options('compiler_cxx') opt.add_option('--debug', action='store_true', default=False, dest='debug', help="Build debuggable binaries [Default: False]") + opt.add_option('--grind', action='store_true', default=False, dest='grind', + help="Run tests in valgrind [Default: False]") opt.add_option('--strict', action='store_true', default=False, dest='strict', help="Use strict compiler flags and show all warnings [Default: False]") opt.add_option('--docs', action='store_true', default=False, dest='docs', @@ -426,7 +428,10 @@ def run_tests(ctx, appname, tests, desired_status=0, dirs=['./src']): if type(i) == type([]): s = ' '.join(i) Logs.pprint('BOLD', 'Running test %s' % s) - if subprocess.call(i, shell=True) == desired_status: + cmd = i + if Options.options.grind: + cmd = 'valgrind ' + i + if subprocess.call(cmd, shell=True) == desired_status: Logs.pprint('GREEN', 'Passed test %s' % s) else: failures += 1 |