@@ -13,7 +13,7 @@ use ui_test::{
13
13
run_tests_generic,
14
14
spanned:: Spanned ,
15
15
status_emitter:: { Gha , StatusEmitter , Text } ,
16
- Args , Config , OutputConflictHandling ,
16
+ Args , Config ,
17
17
} ;
18
18
19
19
/// 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
44
44
. to_string ( ) ,
45
45
) ,
46
46
output_conflict_handling : if env:: var_os ( "BLESS" ) . is_some ( ) {
47
- OutputConflictHandling :: Bless
47
+ ui_test :: bless_output_files
48
48
} else {
49
- // stderr output changes between rust versions so we just rely on annotations
50
- OutputConflictHandling :: Ignore
49
+ ui_test:: error_on_output_conflict
51
50
} ,
52
51
..Config :: rustc ( root_dir)
53
52
} ;
54
53
55
54
config. with_args ( args) ;
56
55
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
+
57
65
let bevy_root = ".." ;
58
66
59
67
// 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
+
71
70
72
71
// Manually insert @aux-build:<dep> comments into test files. This needs to
73
72
// be done to build and link dependencies. Dependencies will be pulled from a
0 commit comments