summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-12-05 14:57:48 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-12-08 17:56:48 +0100
commit146e22fff63b372f6fe19dcfc9bb3e979d9c6191 (patch)
treefd79eea907a6af2f0f7554b0de8e132ceddf472a /util
parent46d18972678f93f9752646105954e03a3aa3a693 (diff)
qt-testrunner: Save test output into file
Aside from the generation of the xml and junit xml files for each test, also save the test output into a tst_{name}-{timestamp}.txt file. This will allow developers to inspect the output of passed tests, by downloading the test results archive, even if we use ctest's --output-on-failure. Change-Id: I0a6c0ee04b4525d3ad9b207b28117d2182d29c28 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/testrunner/qt-testrunner.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/util/testrunner/qt-testrunner.py b/util/testrunner/qt-testrunner.py
index 0bffbfd926..2305e4b4fb 100755
--- a/util/testrunner/qt-testrunner.py
+++ b/util/testrunner/qt-testrunner.py
@@ -251,12 +251,16 @@ def run_full_test(test_basename, testargs: List[str], output_dir: str,
# and text to stdout.
if not no_extra_args:
filename_base = unique_filename(test_basename)
- xml_output_file = os.path.join(output_dir, f"{filename_base}.xml")
+ pathname_stem = os.path.join(output_dir, filename_base)
+ xml_output_file = f"{pathname_stem}.xml"
+
results_files.append(xml_output_file)
output_testargs.extend([
- "-o", xml_output_file + ",xml",
- "-o", os.path.join(output_dir, f"{filename_base}.junit.xml") + ",junitxml",
- "-o", "-,txt"])
+ "-o", f"{xml_output_file},xml",
+ "-o", f"{pathname_stem}.junit.xml,junitxml",
+ "-o", f"{pathname_stem}.txt,txt",
+ "-o", "-,txt"
+ ])
proc = run_test(testargs + specific_extra_args + output_testargs,
timeout=timeout)
@@ -284,9 +288,12 @@ def rerun_failed_testcase(test_basename, testargs: List[str], output_dir: str,
# For the individual testcase re-runs, we log to file since Coin needs
# to parse it. That is the reason we use unique filename every time.
filename_base = unique_filename(test_basename)
+ pathname_stem = os.path.join(output_dir, filename_base)
+
output_args = [
- "-o", os.path.join(output_dir, f"{filename_base}.xml") + ",xml",
- "-o", os.path.join(output_dir, f"{filename_base}.junit.xml") + ",junitxml",
+ "-o", f"{pathname_stem}.xml,xml",
+ "-o", f"{pathname_stem}.junit.xml,junitxml",
+ "-o", f"{pathname_stem}.txt,txt",
"-o", "-,txt"]
L.info("Re-running testcase: %s", failed_arg)
if i < max_repeats - 1: