summaryrefslogtreecommitdiff
path: root/testsuite/driver/testglobals.py
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-04-09 02:32:21 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-04-09 02:34:31 -0700
commitf8e12e2b396e0c475e1403ab8ac3fc4d63c1681e (patch)
treec786e2ddabdcbff559f46f19deff31b8b74d7d1e /testsuite/driver/testglobals.py
parent50bfd4219157473fac47c70993fc2023a162a7f3 (diff)
downloadhaskell-f8e12e2b396e0c475e1403ab8ac3fc4d63c1681e.tar.gz
Fix #5435, adding new test config check_stdout.
check_stdout(f) allows you to override the test framework's diff based output checking with another mechanism. f is a function which takes two arguments: the first is the filename containing the observed stdout, the second is the normaliser that would have been applied (in case you want to read, normalise, and then do something.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'testsuite/driver/testglobals.py')
-rw-r--r--testsuite/driver/testglobals.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 203d85f336..7b9bd9a686 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -252,6 +252,11 @@ class TestOptions:
# Extra output normalisation
self.extra_normaliser = lambda x: x
+ # Custom output checker, otherwise do a comparison with expected
+ # stdout file. Accepts two arguments: filename of actual stdout
+ # output, and a normaliser function given other test options
+ self.check_stdout = None
+
# Extra normalisation for compiler error messages
self.extra_errmsg_normaliser = lambda x: x