summaryrefslogtreecommitdiffstats
path: root/autowaf.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-11 11:56:19 -0400
committerDavid Robillard <d@drobilla.net>2016-07-11 11:56:19 -0400
commit9a3f7779f787f30cafba54290a9700049dfd393d (patch)
treef0ec9e7fadee6f6a1eeb21dce3a4e787717504a1 /autowaf.py
parent6ead4121b50eacb169348918a0482fa9034d1123 (diff)
downloadautowaf-9a3f7779f787f30cafba54290a9700049dfd393d.tar.gz
autowaf-9a3f7779f787f30cafba54290a9700049dfd393d.tar.bz2
autowaf-9a3f7779f787f30cafba54290a9700049dfd393d.zip
Improve test options
Diffstat (limited to 'autowaf.py')
-rw-r--r--autowaf.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/autowaf.py b/autowaf.py
index 5046e37..594f64a 100644
--- a/autowaf.py
+++ b/autowaf.py
@@ -72,8 +72,6 @@ def set_options(opt, debug_by_default=False):
opt.add_option('--pardebug', action='store_true', default=False, dest='pardebug',
help="Build parallel-installable debuggable libraries with D suffix")
- opt.add_option('--grind', action='store_true', default=False, dest='grind',
- help="Run tests in valgrind")
opt.add_option('--strict', action='store_true', default=False, dest='strict',
help="Use strict compiler flags and show all warnings")
opt.add_option('--ultra-strict', action='store_true', default=False, dest='ultra_strict',
@@ -81,6 +79,13 @@ def set_options(opt, debug_by_default=False):
opt.add_option('--docs', action='store_true', default=False, dest='docs',
help="Build documentation - requires doxygen")
+ # Test options
+ test_opts = opt.add_option_group('Test options', '')
+ test_opts.add_option('--test-wrapper', type='string', dest='test_wrapper',
+ help="Command prefix for tests (e.g. valgrind)")
+ test_opts.add_option('--verbose-tests', action='store_true', default=False, dest='verbose_tests',
+ help="Always show test output")
+
g_step = 1
def check_header(conf, lang, name, define='', mandatory=True):
@@ -682,12 +687,16 @@ def run_test(ctx, appname, test, desired_status=0, dirs=['src'], name='', header
if header:
Logs.pprint('Green', '\n** Test %s' % s)
cmd = test
- if Options.options.grind:
- cmd = 'valgrind ' + test
+ if Options.options.test_wrapper:
+ cmd = Options.options.test_wrapper + ' ' + test
if name == '':
name = test
- proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ if Options.options.verbose_tests:
+ proc = subprocess.Popen(cmd, shell=True)
+ else:
+ proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
out = proc.communicate()
returncode = proc.returncode