@@ -50,7 +50,7 @@ def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env={}):
50
50
print ("--- END stderr ---" )
51
51
fail ("exit code was {}" .format (p .returncode ))
52
52
53
- def test_rebuild (name , cmd , rebuild_count_expected ):
53
+ def test_no_rebuild (name , cmd ):
54
54
print ("Testing {}..." .format (name ))
55
55
p = subprocess .Popen (
56
56
cmd ,
@@ -62,12 +62,12 @@ def test_rebuild(name, cmd, rebuild_count_expected):
62
62
stderr = stderr .decode ("UTF-8" )
63
63
if p .returncode != 0 :
64
64
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 :
67
67
print ("--- BEGIN stderr ---" )
68
68
print (stderr , end = "" )
69
69
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)" );
71
71
72
72
def test_cargo_miri_run ():
73
73
test ("`cargo miri run` (no isolation)" ,
@@ -89,9 +89,10 @@ def test_cargo_miri_run():
89
89
env = {'MIRIFLAGS' : "-Zmiri-disable-isolation" },
90
90
)
91
91
# 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)" ,
93
95
cargo_miri ("run" , quiet = False ) + ["--" , "" ],
94
- rebuild_count_expected = 1 ,
95
96
)
96
97
97
98
def test_cargo_miri_test ():
0 commit comments