Commit 5946c85a authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot
Browse files

testsuite: Don't attempt to read .std{err,out} files if they don't exist

Simon reports that he was previously seeing framework failures due to
an attempt to read the non-existing T13456.stderr. While I don't know
exactly what this is due to, it does seem like a non-existing
.std{out,err} file should be equivalent to an empty file. Teach the
testsuite driver to treat it as such.
parent 339e8ece
Pipeline #18485 passed with stages
in 389 minutes and 30 seconds
......@@ -1787,7 +1787,11 @@ def stdout_ok(name: TestName, way: WayName) -> bool:
expected_stdout_file, actual_stdout_file)
def read_stdout( name: TestName ) -> str:
return in_testdir(name, 'run.stdout').read_text(encoding='UTF-8')
path = in_testdir(name, 'run.stdout')
if path.exists():
return path.read_text(encoding='UTF-8')
else:
return ''
def dump_stdout( name: TestName ) -> None:
s = read_stdout(name).strip()
......@@ -1805,7 +1809,11 @@ def stderr_ok(name: TestName, way: WayName) -> bool:
whitespace_normaliser=normalise_whitespace)
def read_stderr( name: TestName ) -> str:
return in_testdir(name, 'run.stderr').read_text(encoding='UTF-8')
path = in_testdir(name, 'run.stderr')
if path.exists():
return path.read_text(encoding='UTF-8')
else:
return ''
def dump_stderr( name: TestName ) -> None:
s = read_stderr(name).strip()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment