Skip to content

Commit 68b8037

Browse files
committed
Unify stderr/stdout handling
1 parent 8e7bafc commit 68b8037

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test-cargo-miri/run-test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def normalize_stdout(str):
2828
return re.sub("finished in \d+\.\d\ds", "finished in $TIME", str)
2929

3030
def check_output(expected, actual, path, name):
31+
expected = open(path).read()
3132
if expected == actual:
3233
return True
3334
print(f"{path} did not match reference!")
@@ -53,8 +54,7 @@ def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env={}):
5354
stdout = stdout.decode("UTF-8")
5455
stderr = stderr.decode("UTF-8")
5556
stdout = normalize_stdout(stdout)
56-
expected_stdout = open(stdout_ref).read()
57-
if p.returncode == 0 and check_output(expected_stdout, stdout, stdout_ref, "stdout") and check_output(open(stderr_ref).read(), stderr, stderr_ref, "stderr"):
57+
if p.returncode == 0 and check_output(stdout, stdout_ref, "stdout") and check_output(stderr, stderr_ref, "stderr"):
5858
# All good!
5959
return
6060
fail("exit code was {}".format(p.returncode))

0 commit comments

Comments
 (0)