77
88import sys , subprocess
99
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 ) )
1212 ## Call `cargo miri`, capture all output
1313 p = subprocess .Popen (
14- [ "cargo" , "miri" , "run" , "-q" ] ,
14+ cmd ,
1515 stdout = subprocess .PIPE ,
1616 stderr = subprocess .PIPE
1717 )
@@ -26,17 +26,20 @@ def test_cargo_miri():
2626 # Test for failures
2727 if p .returncode != 0 :
2828 sys .exit (1 )
29- if stdout != open ('stdout.ref' ).read ():
29+ if stdout != open (stdout_ref ).read ():
3030 print ("stdout does not match reference" )
3131 sys .exit (1 )
32- if stderr != open ('stderr.ref' ).read ():
32+ if stderr != open (stderr_ref ).read ():
3333 print ("stderr does not match reference" )
3434 sys .exit (1 )
3535
36+ def test_cargo_miri_run ():
37+ test ("cargo miri run" , ["cargo" , "miri" , "run" , "-q" ], "stout.ref" , "stderr.ref" )
38+
3639def test_cargo_miri_test ():
37- print ( "==> Testing `cargo miri test` <==" )
38- subprocess . check_call ( ["cargo" , "miri" , "test" ] )
40+ # FIXME: 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" )
3942
40- test_cargo_miri ()
43+ test_cargo_miri_run ()
4144test_cargo_miri_test ()
4245sys .exit (0 )
0 commit comments