diff options
Diffstat (limited to 'testsuite/driver')
-rw-r--r-- | testsuite/driver/testglobals.py | 4 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 18 |
2 files changed, 17 insertions, 5 deletions
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index d3b566c493..d7e63d1c87 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -144,7 +144,6 @@ def getTestRun(): class TestOptions: def __init__(self): - # if not None then we look for namebase.stderr etc rather than # using the test name self.with_namebase = None @@ -253,6 +252,9 @@ class TestOptions: # The directory the test is in self.testdir = '.' + # Should we redirect stdout and stderr to a single file? + self.combined_output = False + # The default set of options global default_testopts default_testopts = TestOptions() diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 15b6d4eb66..ee9cc7c077 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -141,6 +141,9 @@ def ignore_output( opts ): def no_stdin( opts ): opts.no_stdin = 1 +def combined_output( opts ): + opts.combined_output = True + # ----- def expect_fail_for( ways ): @@ -1155,11 +1158,18 @@ def simple_run( name, way, prog, args ): stdin_comes_from = '' else: stdin_comes_from = ' <' + use_stdin + + if opts.combined_output: + redirection = ' >' + run_stdout \ + + ' 2>&1' + else: + redirection = ' >' + run_stdout \ + + ' 2>' + run_stderr + cmd = prog + ' ' + args + ' ' \ + my_rts_flags + ' ' \ + stdin_comes_from \ - + ' >' + run_stdout \ - + ' 2>' + run_stderr + + redirection if getTestOpts().cmd_wrapper != None: cmd = getTestOpts().cmd_wrapper(cmd); @@ -1183,7 +1193,7 @@ def simple_run( name, way, prog, args ): check_prof = my_rts_flags.find("-p") != -1 if not opts.ignore_output: - if not check_stderr_ok(name): + if not opts.combined_output and not check_stderr_ok(name): return failBecause('bad stderr') if not check_stdout_ok(name): return failBecause('bad stdout') @@ -1445,7 +1455,7 @@ def check_stderr_ok( name ): if platform_specific: return str else: - return normalise_output(str) + return normalise_errmsg(str) return compare_outputs('stderr', \ two_normalisers(norm, getTestOpts().extra_normaliser), \ |