@@ -50,7 +50,7 @@ def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env={}):
5050 print ("--- END stderr ---" )
5151 fail ("exit code was {}" .format (p .returncode ))
5252
53- def test_rebuild (name , cmd , rebuild_count_expected ):
53+ def test_no_rebuild (name , cmd ):
5454 print ("Testing {}..." .format (name ))
5555 p = subprocess .Popen (
5656 cmd ,
@@ -62,12 +62,12 @@ def test_rebuild(name, cmd, rebuild_count_expected):
6262 stderr = stderr .decode ("UTF-8" )
6363 if p .returncode != 0 :
6464 fail ("rebuild failed" );
65- rebuild_count = stderr . count ( " Compiling " );
66- if rebuild_count != rebuild_count_expected :
65+ # Also check for 'Running' as a sanity check.
66+ if stderr . count ( " Compiling " ) > 0 or stderr . count ( " Running " ) == 0 :
6767 print ("--- BEGIN stderr ---" )
6868 print (stderr , end = "" )
6969 print ("--- END stderr ---" )
70- fail ("Expected {} rebuild(s), but got {}" . format ( rebuild_count_expected , rebuild_count ) );
70+ fail ("Something was being rebuilt when it should not be (or we got no output)" );
7171
7272def test_cargo_miri_run ():
7373 test ("`cargo miri run` (no isolation)" ,
@@ -89,9 +89,10 @@ def test_cargo_miri_run():
8989 env = {'MIRIFLAGS' : "-Zmiri-disable-isolation" },
9090 )
9191 # Special test: run it again *without* `-q` to make sure nothing is being rebuilt (Miri issue #1722)
92- test_rebuild ("`cargo miri run` (clean rebuild)" ,
92+ # FIXME: move this test up to right after the first `test`
93+ # (currently that fails, only the 3rd and later runs are really clean... see Miri issue #1722)
94+ test_no_rebuild ("`cargo miri run` (no rebuild)" ,
9395 cargo_miri ("run" , quiet = False ) + ["--" , "" ],
94- rebuild_count_expected = 1 ,
9596 )
9697
9798def test_cargo_miri_test ():
0 commit comments