aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjpakkane <jpakkane@gmail.com>2015-03-25 20:17:39 +0200
committerjpakkane <jpakkane@gmail.com>2015-03-25 20:17:39 +0200
commitb723be2640ac2b049d9e4982f56c1cf10657fd53 (patch)
tree0af9e15e67833780fc25cf72b2c14440a821d28f
parent9287d7e2c5e9245189415314ee48566badc228b9 (diff)
parentdccb6a170e7d8efa0cbf7b9c946e9ae93c859833 (diff)
downloadmeson-b723be2640ac2b049d9e4982f56c1cf10657fd53.zip
meson-b723be2640ac2b049d9e4982f56c1cf10657fd53.tar.gz
meson-b723be2640ac2b049d9e4982f56c1cf10657fd53.tar.bz2
Merge pull request #83 from ignatenkobrain/ci_time
tests: add time property
-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')