File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
tests/integrations/basic/tests Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ impl Default for Config {
74
74
}
75
75
}
76
76
77
+ impl Config {
78
+ pub fn stderr_filter ( & mut self , pattern : & str , replacement : & ' static str ) {
79
+ self . stderr_filters
80
+ . push ( ( Regex :: new ( pattern) . unwrap ( ) , replacement) ) ;
81
+ }
82
+ }
83
+
77
84
#[ derive( Debug ) ]
78
85
pub struct DependencyBuilder {
79
86
pub program : PathBuf ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ error[E0308]: mismatched types
7
7
| arguments to this function are incorrect
8
8
|
9
9
note: function defined here
10
- --> /home/ubuntu/crates/ui_test /tests/integrations/basic/src/lib.rs:1:8
10
+ --> $DIR /tests/integrations/basic/src/lib.rs:1:8
11
11
|
12
12
1 | pub fn add(left: usize, right: usize) -> usize {
13
13
| ^^^
Original file line number Diff line number Diff line change 1
1
use ui_test:: * ;
2
2
3
3
fn main ( ) -> ui_test:: color_eyre:: Result < ( ) > {
4
- let config = Config {
4
+ let path = "../../../target" ;
5
+ let mut config = Config {
5
6
quiet : false ,
6
7
root_dir : "tests/actual_tests" . into ( ) ,
7
8
dependencies_crate_manifest_path : Some ( "tests/dummy_crate/Cargo.toml" . into ( ) ) ,
8
9
dependency_builder : Some ( DependencyBuilder {
9
10
program : std:: path:: PathBuf :: from ( "cargo" ) ,
10
11
args : vec ! [ ] ,
11
- envs : vec ! [ ( "CARGO_TARGET_DIR" . into( ) , "../../../target" . into( ) ) ] ,
12
+ envs : vec ! [ ( "CARGO_TARGET_DIR" . into( ) , path . into( ) ) ] ,
12
13
} ) ,
13
14
args : vec ! [ "--edition=2021" . into( ) ] ,
14
15
output_conflict_handling : if std:: env:: var_os ( "BLESS" ) . is_some ( ) {
15
16
OutputConflictHandling :: Bless
16
17
} else {
17
18
OutputConflictHandling :: Error
18
19
} ,
19
- .. Config :: default ( )
20
+ ..Config :: default ( )
20
21
} ;
22
+ config. stderr_filter ( r"[^ ]*/\.?cargo/registry/.*/" , "$$CARGO_REGISTRY" ) ;
23
+ config. stderr_filter (
24
+ & std:: path:: Path :: new ( path)
25
+ . canonicalize ( )
26
+ . unwrap ( )
27
+ . parent ( )
28
+ . unwrap ( )
29
+ . display ( )
30
+ . to_string ( ) ,
31
+ "$$DIR" ,
32
+ ) ;
21
33
ui_test:: run_tests ( config)
22
34
}
You can’t perform that action at this time.
0 commit comments