Skip to content

Commit b7d9861

Browse files
committed
test: relax panic output assertion
rust-lang/rust#122565 adds a new line to thread panic output. To make the current test suites works on stable, beta, and nightly, similar to #14602, this relaxes the assertion around that by globbing everything.
1 parent 0276088 commit b7d9861

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

tests/build-std/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ fn remap_path_scope() {
376376
str![[r#"
377377
[FINISHED] `release` profile [optimized + debuginfo] target(s) in [ELAPSED]s
378378
[RUNNING] `target/[HOST_TARGET]/release/foo`
379+
...
379380
[..]thread '[..]' panicked at [..]src/main.rs:3:[..]:
380381
[..]remap to /rustc/<hash>[..]
381382
[..]at /rustc/[..]/library/std/src/[..]

tests/testsuite/build_script.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,7 @@ fn warnings_emitted_when_build_script_panics() {
40004000
fn main() {
40014001
println!("cargo::warning=foo");
40024002
println!("cargo::warning=bar");
4003-
panic!();
4003+
panic!("our crate panicked");
40044004
}
40054005
"#,
40064006
)
@@ -4022,10 +4022,9 @@ Caused by:
40224022
cargo::warning=bar
40234023
40244024
--- stderr
4025-
thread 'main' panicked at build.rs:5:21:
4026-
explicit panic
4027-
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4028-
4025+
...
4026+
[..]our crate panicked[..]
4027+
...
40294028
"#]])
40304029
.run();
40314030
}
@@ -4039,7 +4038,7 @@ fn warnings_emitted_when_dependency_panics() {
40394038
fn main() {
40404039
println!("cargo::warning=foo");
40414040
println!("cargo::warning=bar");
4042-
panic!();
4041+
panic!("dependency panicked");
40434042
}
40444043
"#,
40454044
)
@@ -4093,10 +4092,9 @@ Caused by:
40934092
cargo::warning=bar
40944093
40954094
--- stderr
4096-
thread 'main' panicked at [ROOT]/home/.cargo/registry/src/-[HASH]/published-0.1.0/build.rs:5:21:
4097-
explicit panic
4098-
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4099-
4095+
...
4096+
[..]dependency panicked[..]
4097+
...
41004098
"#]])
41014099
.run();
41024100
}

0 commit comments

Comments
 (0)