7
7
8
8
import sys , subprocess
9
9
10
- def test_cargo_miri ( ):
11
- print ("==> Testing `cargo miri run ` <==" )
10
+ def test ( name , cmd , stdout_ref , stderr_ref ):
11
+ print ("==> Testing `{} ` <==" . format ( name ) )
12
12
## Call `cargo miri`, capture all output
13
13
p = subprocess .Popen (
14
- [ "cargo" , "miri" , "run" , "-q" ] ,
14
+ cmd ,
15
15
stdout = subprocess .PIPE ,
16
16
stderr = subprocess .PIPE
17
17
)
@@ -26,17 +26,20 @@ def test_cargo_miri():
26
26
# Test for failures
27
27
if p .returncode != 0 :
28
28
sys .exit (1 )
29
- if stdout != open ('stdout.ref' ).read ():
29
+ if stdout != open (stdout_ref ).read ():
30
30
print ("stdout does not match reference" )
31
31
sys .exit (1 )
32
- if stderr != open ('stderr.ref' ).read ():
32
+ if stderr != open (stderr_ref ).read ():
33
33
print ("stderr does not match reference" )
34
34
sys .exit (1 )
35
35
36
+ def test_cargo_miri_run ():
37
+ test ("cargo miri run" , ["cargo" , "miri" , "run" , "-q" ], "stout.ref" , "stderr.ref" )
38
+
36
39
def test_cargo_miri_test ():
37
- print ( "==> Testing `cargo miri test` <==" )
38
- subprocess . check_call ( ["cargo" , "miri" , "test" ] )
40
+ # validation disabled for now because of https://github.com/rust-lang/rust/issues/54957
41
+ test ( "cargo miri test" , ["cargo" , "miri" , "test" , "-q" , "--" , "-Zmiri-disable-validation" ], "stout.ref" , "stderr.ref" )
39
42
40
- test_cargo_miri ()
43
+ test_cargo_miri_run ()
41
44
test_cargo_miri_test ()
42
45
sys .exit (0 )
0 commit comments