aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>2015-03-25 20:39:11 +0300
committerIgor Gnatenko <i.gnatenko.brain@gmail.com>2015-03-25 20:39:11 +0300
commitdccb6a170e7d8efa0cbf7b9c946e9ae93c859833 (patch)
tree0af9e15e67833780fc25cf72b2c14440a821d28f /run_tests.py
parent9287d7e2c5e9245189415314ee48566badc228b9 (diff)
downloadmeson-dccb6a170e7d8efa0cbf7b9c946e9ae93c859833.zip
meson-dccb6a170e7d8efa0cbf7b9c946e9ae93c859833.tar.gz
meson-dccb6a170e7d8efa0cbf7b9c946e9ae93c859833.tar.bz2
tests: add time property
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/run_tests.py b/run_tests.py
index 258f8d3..c789fb9 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -20,6 +20,7 @@ import environment
import mesonlib
import argparse
import xml.etree.ElementTree as ET
+import time
from meson import backendlist
@@ -255,14 +256,17 @@ def run_tests():
current_suite = ET.SubElement(junit_root, 'testsuite', {'name' : name, 'tests' : str(len(test_cases))})
print('\nRunning %s tests.\n' % name)
for t in test_cases:
+ ts = time.time()
(msg, stdo, stde) = run_test(t, name != 'failing')
+ te = time.time()
log_text_file(logfile, t, msg, stdo, stde)
# Jenkins screws us over by automatically sorting test cases by name
# and getting it wrong by not doing logical number sorting.
(testnum, testbase) = os.path.split(t)[-1].split(' ', 1)
testname = '%.3d %s' % (int(testnum), testbase)
current_test = ET.SubElement(current_suite, 'testcase', {'name' : testname,
- 'classname' : name})
+ 'classname' : name,
+ 'time' : '%.3f' % (te - ts)})
if msg != '':
ET.SubElement(current_test, 'failure', {'message' : msg})
stdoel = ET.SubElement(current_test, 'system-out')