Skip to content

Commit 2c3c82c

Browse files
Add new run_make_support::CompletedProcess::assert_ice method
1 parent 5d0011c commit 2c3c82c

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/tools/run-make-support/src/command.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,13 @@ impl CompletedProcess {
387387
self
388388
}
389389

390+
/// Checks that `stderr` doesn't contain the Internal Compiler Error message.
391+
#[track_caller]
392+
pub fn assert_not_ice(&self) -> &Self {
393+
self.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug");
394+
self
395+
}
396+
390397
/// Checks that `stderr` does not contain the regex pattern `unexpected`.
391398
#[track_caller]
392399
pub fn assert_stderr_not_contains_regex<S: AsRef<str>>(&self, unexpected: S) -> &Self {

tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ fn main() {
4343
.extern_("minibevy", "libminibevy-b.rmeta")
4444
.extern_("minirapier", "libminirapier.rmeta")
4545
.run_fail()
46-
.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug");
46+
.assert_not_ice();
4747
}

tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ fn main() {
2424
.arg(format!("--include-parts-dir={}", parts_out_dir.display()))
2525
.arg("--merge=finalize")
2626
.run();
27-
output.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
27+
output.assert_not_ice();
2828
}

tests/run-make/rustdoc-test-builder/rmake.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ fn main() {
1515
.arg(&absolute_path)
1616
.run_fail();
1717

18-
// We also double-check that we don't have the panic text in the output.
18+
// We check that rustdoc outputs the error correctly...
1919
output.assert_stdout_contains("Failed to spawn ");
20-
output.assert_stderr_not_contains("the compiler unexpectedly panicked. this is a bug.");
21-
// Just in case...
22-
output.assert_stdout_not_contains("the compiler unexpectedly panicked. this is a bug.");
20+
// ... and that we didn't panic.
21+
output.assert_not_ice();
2322
}

0 commit comments

Comments
 (0)