Skip to content

Commit 8778220

Browse files
committed
Update ui_test dependency to newest version (0.29.0)
1 parent 11db717 commit 8778220

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

tools/ci/src/commands/compile_fail.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Prepare for CompileFailCommand {
1818

1919
// Macro Compile Fail Tests
2020
// Run tests (they do not get executed with the workspace tests)
21-
// - See crates/bevy_macros_compile_fail_tests/README.md
21+
// - See crates/bevy_derive/compile_fail/README.md
2222
commands.push(
2323
PreparedCommand::new::<Self>(
2424
cmd!(sh, "cargo test --target-dir ../../../target {no_fail_fast}"),
@@ -29,7 +29,7 @@ impl Prepare for CompileFailCommand {
2929

3030
// ECS Compile Fail Tests
3131
// Run UI tests (they do not get executed with the workspace tests)
32-
// - See crates/bevy_ecs_compile_fail_tests/README.md
32+
// - See crates/bevy_ec/compile_fail/README.md
3333
commands.push(
3434
PreparedCommand::new::<Self>(
3535
cmd!(sh, "cargo test --target-dir ../../../target {no_fail_fast}"),

tools/compile_fail_utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
88
publish = false
99

1010
[dependencies]
11-
ui_test = "0.23.0"
11+
ui_test = "0.29.0"
1212

1313
[[test]]
1414
name = "example"

tools/compile_fail_utils/src/lib.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use ui_test::{
1313
run_tests_generic,
1414
spanned::Spanned,
1515
status_emitter::{Gha, StatusEmitter, Text},
16-
Args, Config, OutputConflictHandling,
16+
Args, Config,
1717
};
1818

1919
/// Use this instead of hand rolling configs.
@@ -44,30 +44,29 @@ fn basic_config(root_dir: impl Into<PathBuf>, args: &Args) -> ui_test::Result<Co
4444
.to_string(),
4545
),
4646
output_conflict_handling: if env::var_os("BLESS").is_some() {
47-
OutputConflictHandling::Bless
47+
ui_test::bless_output_files
4848
} else {
49-
// stderr output changes between rust versions so we just rely on annotations
50-
OutputConflictHandling::Ignore
49+
ui_test::error_on_output_conflict
5150
},
5251
..Config::rustc(root_dir)
5352
};
5453

5554
config.with_args(args);
5655

56+
// Window paths (cargo should already be doing this, but just in case).
57+
config.stderr_filter(r"\\", "/");
58+
// Replace line and column numbers (regex patterns shamelessly stolen from miri).
59+
config.stderr_filter(r"\.rs:[0-9]+:[0-9]+(: [0-9]+:[0-9]+)?", ".rs:LL:CC");
60+
// Replace stdlib path (stolen from miri again).
61+
config.stderr_filter(r"[^ \n`]*/(?:rust[^/]*|checkout|[0-9a-fA-F]*)/library/", "RUSTLIB/");
62+
// Replace long type file names since they contain random numbers
63+
config.stderr_filter(r"[\p{L}\p{N}_]+\.long-type-\d+\.txt", "long-type.sr'");
64+
5765
let bevy_root = "..";
5866

5967
// Don't leak contributor filesystem paths
60-
config.path_stderr_filter(Path::new(bevy_root), b"$BEVY_ROOT");
61-
config.path_stderr_filter(Path::new(env!("RUSTUP_HOME")), b"$RUSTUP_HOME");
62-
63-
// ui_test doesn't compile regex with perl character classes.
64-
// \pL = unicode class for letters, \pN = unicode class for numbers
65-
config.stderr_filter(r"\/home\/[\pL\pN_@#\-\. ]+", "$HOME");
66-
// Paths in .stderr seem to always be normalized to use /. Handle both anyway.
67-
config.stderr_filter(
68-
r"[a-zA-Z]:(?:\\|\/)users(?:\\|\/)[\pL\pN_@#\-\. ]+", // NOTE: [\pL\pN_@#\-\. ] is a poor attempt at handling usernames
69-
"$HOME",
70-
);
68+
config.path_stderr_filter(Path::new(bevy_root), b"BEVY_ROOT");
69+
7170

7271
// Manually insert @aux-build:<dep> comments into test files. This needs to
7372
// be done to build and link dependencies. Dependencies will be pulled from a

0 commit comments

Comments
 (0)