@@ -25,7 +25,12 @@ def cargo_miri(cmd, quiet = True):
25
25
26
26
def normalize_stdout (str ):
27
27
str = str .replace ("src\\ " , "src/" ) # normalize paths across platforms
28
- return re .sub ("finished in \d+\.\d\ds" , "finished in $TIME" , str )
28
+ str = re .sub ("finished in \d+\.\d\ds" , "finished in $TIME" , str ) # the time keeps changing, obviously
29
+ return str
30
+
31
+ def normalize_stderr (str ):
32
+ str = str .replace ("Preparing a sysroot for Miri... done\n " , "" ) # remove leading cargo-miri setup output
33
+ return str
29
34
30
35
def check_output (actual , path , name ):
31
36
expected = open (path ).read ()
@@ -51,9 +56,8 @@ def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env={}):
51
56
env = p_env ,
52
57
)
53
58
(stdout , stderr ) = p .communicate (input = stdin )
54
- stdout = stdout .decode ("UTF-8" )
55
- stderr = stderr .decode ("UTF-8" )
56
- stdout = normalize_stdout (stdout )
59
+ stdout = normalize_stdout (stdout .decode ("UTF-8" ))
60
+ stderr = normalize_stderr (stderr .decode ("UTF-8" ))
57
61
58
62
stdout_matches = check_output (stdout , stdout_ref , "stdout" )
59
63
stderr_matches = check_output (stderr , stderr_ref , "stderr" )
@@ -175,10 +179,6 @@ def test_cargo_miri_test():
175
179
target_str = " for target {}" .format (os .environ ['MIRI_TEST_TARGET' ]) if 'MIRI_TEST_TARGET' in os .environ else ""
176
180
print (CGREEN + CBOLD + "## Running `cargo miri` tests{}" .format (target_str ) + CEND )
177
181
178
- if not 'MIRI_SYSROOT' in os .environ :
179
- # Make sure we got a working sysroot.
180
- # (If the sysroot gets built later when output is compared, that leads to test failures.)
181
- subprocess .run (cargo_miri ("setup" ), check = True )
182
182
test_cargo_miri_run ()
183
183
test_cargo_miri_test ()
184
184
# Ensure we did not create anything outside the expected target dir.
0 commit comments