diff options
author | David Robillard <d@drobilla.net> | 2013-02-25 19:36:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-02-25 19:36:37 +0000 |
commit | 1bf87bcea31db80737aa2fa5102b896c80c7f85e (patch) | |
tree | f2c96a0c380704fa6feadcaa9e054760aeb2c773 | |
parent | 0d3597166c32378259621fd5618997931189a35f (diff) | |
download | autowaf-1bf87bcea31db80737aa2fa5102b896c80c7f85e.tar.gz autowaf-1bf87bcea31db80737aa2fa5102b896c80c7f85e.tar.bz2 autowaf-1bf87bcea31db80737aa2fa5102b896c80c7f85e.zip |
Make verbose test output optional.
git-svn-id: http://svn.drobilla.net/autowaf@92 e2e4594f-ea7b-45dc-bc5a-5f5301e603aa
-rw-r--r-- | autowaf.py | 33 |
1 files changed, 19 insertions, 14 deletions
@@ -687,7 +687,24 @@ def post_test(ctx, appname, dirs=['src'], remove=['*boost*', 'c++*']): Logs.pprint('BOLD', 'Coverage:', sep='') print('<file://%s>\n\n' % os.path.abspath('coverage/index.html')) -def run_tests(ctx, appname, tests, desired_status=0, dirs=['src'], name='*'): +def run_test(ctx, appname, test, desired_status=0, dirs=['src'], name='', header=False): + s = test + if type(test) == type([]): + s = ' '.join(i) + if header: + Logs.pprint('BOLD', '** Test', sep='') + Logs.pprint('NORMAL', '%s' % s) + cmd = test + if Options.options.grind: + cmd = 'valgrind ' + test + if subprocess.call(cmd, shell=True) == desired_status: + Logs.pprint('GREEN', '** Pass %s' % name) + return True + else: + Logs.pprint('RED', '** FAIL %s' % name) + return False + +def run_tests(ctx, appname, tests, desired_status=0, dirs=['src'], name='*', headers=False): failures = 0 diropts = '' for i in dirs: @@ -695,20 +712,8 @@ def run_tests(ctx, appname, tests, desired_status=0, dirs=['src'], name='*'): # Run all tests for i in tests: - s = i - if type(i) == type([]): - s = ' '.join(i) - print('') - Logs.pprint('BOLD', '** Test', sep='') - Logs.pprint('NORMAL', '%s' % s) - cmd = i - if Options.options.grind: - cmd = 'valgrind ' + i - if subprocess.call(cmd, shell=True) == desired_status: - Logs.pprint('GREEN', '** Pass') - else: + if not run_test(ctx, appname, i, desired_status, dirs, i, headers): failures += 1 - Logs.pprint('RED', '** FAIL') print('') if failures == 0: |