summaryrefslogtreecommitdiff
path: root/testsuite/driver/testglobals.py
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-01-24 14:20:11 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-10 08:37:59 -0500
commit224fec6983e16ecfc44a80d47e591a2425468eaf (patch)
tree08cf0a5b5352c48d99c9783fb657d18e938ba461 /testsuite/driver/testglobals.py
parenta48753bdbc99cda36890e851950f5b79e1c3b2b2 (diff)
downloadhaskell-224fec6983e16ecfc44a80d47e591a2425468eaf.tar.gz
testsuite: Report stdout and stderr in JUnit output
This patch makes the JUnit output more useful as now we also report the stdout/stderr in the message which can be used to quickly identify why a test is failing without downloading the log. This also introduces TestResult, previously we were simply passing around tuples, making things the implementation rather difficult to follow and harder to extend.
Diffstat (limited to 'testsuite/driver/testglobals.py')
-rw-r--r--testsuite/driver/testglobals.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 0e0240db8e..de1d1e660a 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -151,6 +151,20 @@ ghc_env = os.environ.copy()
# -----------------------------------------------------------------------------
# Information about the current test run
+class TestResult:
+ """
+ A result from the execution of a test. These live in the expected_passes,
+ framework_failures, framework_warnings, unexpected_passes,
+ unexpected_failures, unexpected_stat_failures lists of TestRun.
+ """
+ __slots__ = 'directory', 'testname', 'reason', 'way', 'stderr'
+ def __init__(self, directory, testname, reason, way, stderr=None):
+ self.directory = directory
+ self.testname = testname
+ self.reason = reason
+ self.way = way
+ self.stderr = stderr
+
class TestRun:
def __init__(self):
self.start_time = None
@@ -161,6 +175,7 @@ class TestRun:
self.n_expected_passes = 0
self.n_expected_failures = 0
+ # type: List[TestResult]
self.missing_libs = []
self.framework_failures = []
self.framework_warnings = []