diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-09-11 17:45:11 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-09-11 17:45:11 +0000 |
commit | ff058f0a701b601f1593f2a9c8030acb652fdba6 (patch) | |
tree | 4fde63c42a5ffd96c7ebf9bb3f0f00b2b10f5895 /utils/lit/lit/main.py | |
parent | 15f387c93ef8d5c23f110143996c8b9b4a089864 (diff) | |
download | llvm-ff058f0a701b601f1593f2a9c8030acb652fdba6.tar.gz llvm-ff058f0a701b601f1593f2a9c8030acb652fdba6.tar.bz2 llvm-ff058f0a701b601f1593f2a9c8030acb652fdba6.tar.xz |
[lit] Add support for attach arbitrary metrics to test results.
- This is a work-in-progress and all details are subject to change, but I am
trying to build up support for allowing lit to be used as a driver for
performance tests (or other tests which might want to record information
beyond simple PASS/FAIL).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190535 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit/lit/main.py')
-rwxr-xr-x | utils/lit/lit/main.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py index 50c9a66c8d..b93aa6fd0b 100755 --- a/utils/lit/lit/main.py +++ b/utils/lit/lit/main.py @@ -45,15 +45,28 @@ class TestingProgressDisplay(object): if self.progressBar: self.progressBar.clear() - print('%s: %s (%d of %d)' % (test.result.code.name, test.getFullName(), + # Show the test result line. + test_name = test.getFullName() + print('%s: %s (%d of %d)' % (test.result.code.name, test_name, self.completed, self.numTests)) + # Show the test failure output, if requested. if test.result.code.isFailure and self.opts.showOutput: print("%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(), '*'*20)) print(test.result.output) print("*" * 20) + # Report test metrics, if present. + if test.result.metrics: + print("%s TEST '%s' RESULTS %s" % ('*'*10, test.getFullName(), + '*'*10)) + items = sorted(test.result.metrics.items()) + for metric_name, value in items: + print('%s: %s ' % (metric_name, value.format())) + print("*" * 10) + + # Ensure the output is flushed. sys.stdout.flush() def main(builtinParameters = {}): |