@@ -21,13 +21,16 @@ def cargo_miri(cmd):
2121 args += ["--target" , os .environ ['MIRI_TEST_TARGET' ]]
2222 return args
2323
24- def test (name , cmd , stdout_ref , stderr_ref ):
24+ def test (name , cmd , stdout_ref , stderr_ref , env = {} ):
2525 print ("==> Testing `{}` <==" .format (name ))
2626 ## Call `cargo miri`, capture all output
27+ p_env = os .environ .copy ()
28+ p_env .update (env )
2729 p = subprocess .Popen (
2830 cmd ,
2931 stdout = subprocess .PIPE ,
30- stderr = subprocess .PIPE
32+ stderr = subprocess .PIPE ,
33+ env = p_env ,
3134 )
3235 (stdout , stderr ) = p .communicate ()
3336 stdout = stdout .decode ("UTF-8" )
@@ -55,29 +58,31 @@ def test_cargo_miri_run():
5558 "stdout.ref" , "stderr.ref"
5659 )
5760 test ("cargo miri run (with arguments)" ,
58- cargo_miri ("run" ) + ["--" , "--" , " hello world" , '"hello world"' ],
61+ cargo_miri ("run" ) + ["--" , "hello world" , '"hello world"' ],
5962 "stdout.ref" , "stderr.ref2"
6063 )
6164
6265def test_cargo_miri_test ():
6366 test ("cargo miri test" ,
64- cargo_miri ("test" ) + ["--" , "-Zmiri-seed=feed" ],
65- "test.stdout.ref" , "test.stderr.ref"
67+ cargo_miri ("test" ),
68+ "test.stdout.ref" , "test.stderr.ref" ,
69+ env = {'MIRIFLAGS' : "-Zmiri-seed=feed" },
6670 )
6771 test ("cargo miri test (with filter)" ,
68- cargo_miri ("test" ) + ["--" , "--" , "le1" ],
72+ cargo_miri ("test" ) + ["--" , "--format=pretty " , "le1" ],
6973 "test.stdout.ref2" , "test.stderr.ref"
7074 )
7175 test ("cargo miri test (without isolation)" ,
72- cargo_miri ("test" ) + ["--" , "-Zmiri-disable-isolation" , "--" , "num_cpus" ],
73- "test.stdout.ref3" , "test.stderr.ref"
76+ cargo_miri ("test" ) + ["--" , "--format=pretty" , "num_cpus" ],
77+ "test.stdout.ref3" , "test.stderr.ref" ,
78+ env = {'MIRIFLAGS' : "-Zmiri-disable-isolation" },
7479 )
7580 test ("cargo miri test (test target)" ,
76- cargo_miri ("test" ) + ["--test" , "test" ],
81+ cargo_miri ("test" ) + ["--test" , "test" , "--" , "--format=pretty" ],
7782 "test.stdout.ref4" , "test.stderr.ref"
7883 )
7984 test ("cargo miri test (bin target)" ,
80- cargo_miri ("test" ) + ["--bin" , "cargo-miri-test" ],
85+ cargo_miri ("test" ) + ["--bin" , "cargo-miri-test" , "--" , "--format=pretty" ],
8186 "test.stdout.ref5" , "test.stderr.ref"
8287 )
8388
0 commit comments