Skip to content

Commit dd100bf

Browse files
committed
Auto merge of #2938 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 4b90db3 + 93007aa commit dd100bf

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
677710eaf0a0bdb008959ee8717c9fe1c6d187b3
1+
0928a1f7574f5ca019b5443b3a90008588d18c8c

test-cargo-miri/run-test.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
and the working directory to contain the cargo-miri-test project.
66
'''
77

8-
import sys, subprocess, os, re, difflib
8+
import difflib
9+
import os
10+
import re
11+
import sys
12+
import subprocess
913

1014
CGREEN = '\33[32m'
1115
CBOLD = '\33[1m'
@@ -46,7 +50,9 @@ def check_output(actual, path, name):
4650
print(f"--- END diff {name} ---")
4751
return False
4852

49-
def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env={}):
53+
def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env=None):
54+
if env is None:
55+
env = {}
5056
print("Testing {}...".format(name))
5157
## Call `cargo miri`, capture all output
5258
p_env = os.environ.copy()
@@ -64,13 +70,15 @@ def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env={}):
6470

6571
stdout_matches = check_output(stdout, stdout_ref, "stdout")
6672
stderr_matches = check_output(stderr, stderr_ref, "stderr")
67-
73+
6874
if p.returncode == 0 and stdout_matches and stderr_matches:
6975
# All good!
7076
return
7177
fail("exit code was {}".format(p.returncode))
7278

73-
def test_no_rebuild(name, cmd, env={}):
79+
def test_no_rebuild(name, cmd, env=None):
80+
if env is None:
81+
env = {}
7482
print("Testing {}...".format(name))
7583
p_env = os.environ.copy()
7684
p_env.update(env)
@@ -84,13 +92,13 @@ def test_no_rebuild(name, cmd, env={}):
8492
stdout = stdout.decode("UTF-8")
8593
stderr = stderr.decode("UTF-8")
8694
if p.returncode != 0:
87-
fail("rebuild failed");
95+
fail("rebuild failed")
8896
# Also check for 'Running' as a sanity check.
8997
if stderr.count(" Compiling ") > 0 or stderr.count(" Running ") == 0:
9098
print("--- BEGIN stderr ---")
9199
print(stderr, end="")
92100
print("--- END stderr ---")
93-
fail("Something was being rebuilt when it should not be (or we got no output)");
101+
fail("Something was being rebuilt when it should not be (or we got no output)")
94102

95103
def test_cargo_miri_run():
96104
test("`cargo miri run` (no isolation)",

0 commit comments

Comments
 (0)