Skip to content

Commit 65625e1

Browse files
authored
Merge pull request #180 from Alexendoo/parent-dir
Remove `$DIR` replacement of test's parent directory
2 parents bfb22b2 + a927de8 commit 65625e1

38 files changed

+77
-84
lines changed

src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ fn check_output(
11961196
revision: &str,
11971197
) -> PathBuf {
11981198
let target = config.target.as_ref().unwrap();
1199-
let output = normalize(path, output, filters, comments, revision, kind);
1199+
let output = normalize(output, filters, comments, revision, kind);
12001200
let path = output_path(path, comments, revised(revision, kind), target, revision);
12011201
match &config.output_conflict_handling {
12021202
OutputConflictHandling::Error(bless_command) => {
@@ -1287,20 +1287,13 @@ fn get_pointer_width(triple: &str) -> u8 {
12871287
}
12881288

12891289
fn normalize(
1290-
path: &Path,
12911290
text: &[u8],
12921291
filters: &Filter,
12931292
comments: &Comments,
12941293
revision: &str,
12951294
kind: &'static str,
12961295
) -> Vec<u8> {
1297-
// Useless paths
1298-
let path_filter = (Match::from(path.parent().unwrap()), b"$DIR" as &[u8]);
1299-
let filters = filters.iter().chain(std::iter::once(&path_filter));
13001296
let mut text = text.to_owned();
1301-
if let Some(lib_path) = option_env!("RUSTC_LIB_PATH") {
1302-
text = text.replace(lib_path, "RUSTLIB");
1303-
}
13041297

13051298
for (rule, replacement) in filters {
13061299
text = rule.replace_all(&text, replacement).into_owned();

tests/integrations/basic-bin/tests/actual_tests/foomp.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0432]: unresolved import `basic_bin`
2-
--> $DIR/foomp.rs:1:5
2+
--> tests/actual_tests/foomp.rs:1:5
33
|
44
1 | use basic_bin::add;
55
| ^^^^^^^^^ use of undeclared crate or module `basic_bin`

tests/integrations/basic-fail-mode/tests/actual_tests/foomp.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/foomp.rs:4:9
2+
--> tests/actual_tests/foomp.rs:4:9
33
|
44
4 | add("42", 3);
55
| --- ^^^^ expected `usize`, found `&str`

tests/integrations/basic-fail/Cargo.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Location:
55
error: test failed, to rerun pass `--test ui_tests`
66

77
Caused by:
8-
process didn't exit successfully: `$DIR/target/ui/$DIR/debug/deps/ui_tests-HASH` (exit status: 1)
8+
process didn't exit successfully: `$DIR/target/ui/tests/integrations/basic-fail/debug/deps/ui_tests-HASH` (exit status: 1)
99
thread 'main' panicked at tests/ui_tests_bless.rs:52:18:
1010
invalid mode/result combo: yolo: Err(tests failed
1111

@@ -22,15 +22,15 @@ Location:
2222
error: test failed, to rerun pass `--test ui_tests_invalid_program`
2323

2424
Caused by:
25-
process didn't exit successfully: `$DIR/target/ui/$DIR/debug/deps/ui_tests_invalid_program-HASH` (exit status: 1)
25+
process didn't exit successfully: `$DIR/target/ui/tests/integrations/basic-fail/debug/deps/ui_tests_invalid_program-HASH` (exit status: 1)
2626
Error: tests failed
2727

2828
Location:
2929
$DIR/src/lib.rs:LL:CC
3030
error: test failed, to rerun pass `--test ui_tests_invalid_program2`
3131

3232
Caused by:
33-
process didn't exit successfully: `$DIR/target/ui/$DIR/debug/deps/ui_tests_invalid_program2-HASH` (exit status: 1)
33+
process didn't exit successfully: `$DIR/target/ui/tests/integrations/basic-fail/debug/deps/ui_tests_invalid_program2-HASH` (exit status: 1)
3434
error: 4 targets failed:
3535
`--test ui_tests`
3636
`--test ui_tests_bless`

tests/integrations/basic-fail/Cargo.stdout

Lines changed: 21 additions & 21 deletions
Large diffs are not rendered by default.

tests/integrations/basic-fail/tests/actual_tests/bad_pattern.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/bad_pattern.rs:4:9
2+
--> tests/actual_tests/bad_pattern.rs:4:9
33
|
44
4 | add("42", 3);
55
| --- ^^^^ expected `usize`, found `&str`

tests/integrations/basic-fail/tests/actual_tests/foomp.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/foomp.rs:4:9
2+
--> tests/actual_tests/foomp.rs:4:9
33
|
44
4 | add("42", 3);
55
| --- ^^^^ expected `usize`, found `&str`
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/tests/integrations/basic/src/lib.rs:1:8
99
|
1010
1 | pub fn add(left: usize, right: usize) -> usize {
11-
| ^^^ some expected text that isn't in the actual message
11+
| ^^^ some expected text that isn't in the actual message
1212

1313
error: aborting doo to previous error
1414

tests/integrations/basic-fail/tests/actual_tests/foomp2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/foomp2.rs:4:9
2+
--> tests/actual_tests/foomp2.rs:4:9
33
|
44
4 | add("42", 3);
55
| --- ^^^^ expected `usize`, found `&str`

tests/integrations/basic-fail/tests/actual_tests/rustc_ice.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: internal compiler error: no errors reported for args
2-
--> $DIR/rustc_ice.rs:8:5
2+
--> tests/actual_tests/rustc_ice.rs:8:5
33
|
44
8 | add("42", 3);
55
| ^^^^^^^^^^^^

tests/integrations/basic-fail/tests/actual_tests_bless/aux_proc_macro_no_main.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `!` or `::`, found `<eof>`
2-
--> $DIR/aux_proc_macro_no_main.rs:7:8
2+
--> tests/actual_tests_bless/aux_proc_macro_no_main.rs:7:8
33
|
44
7 | thing!(cake);
55
| ^^^^ expected one of `!` or `::`

0 commit comments

Comments
 (0)