Skip to content

Commit 234db5c

Browse files
committed
fixup: Bless and update ui-cargo tests
1 parent f7ae914 commit 234db5c

File tree

32 files changed

+357
-134
lines changed

32 files changed

+357
-134
lines changed

tests/compile-test.rs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,41 @@ fn run_ui_cargo() {
108108

109109
let mut config = base_config("ui-cargo");
110110
config.args = vec![
111-
"test".into(),
111+
"clippy".into(),
112112
"--color".into(),
113113
"never".into(),
114-
"--jobs".into(),
115-
"1".into(),
116-
"--no-fail-fast".into(),
117114
"--target-dir".into(),
118115
"target/ui_test_cargo".into(),
119116
"--manifest-path".into(),
120117
];
121-
config.trailing_args = vec!["--".into(), "--test-threads".into(), "1".into()];
122118
config.program = "cargo".into();
119+
config.out_dir = None;
120+
121+
config.stderr_filter("in ([0-9]m )?[0-9\\.]+s", "");
122+
config.stdout_filter("in ([0-9]m )?[0-9\\.]+s", "");
123+
config.stderr_filter("( +Running [^(]+).*", "$1");
124+
config.stderr_filter(" *Blocking waiting for.*\n", "");
125+
config.stderr_filter(" *(Compiling|Downloaded|Downloading) .*\n", "");
126+
config.stderr_filter(r#""--out-dir"(,)? "[^"]+""#, r#""--out-dir"$1 "$$TMP"#);
127+
config.stderr_filter("( *process didn't exit successfully: `[^-]+)-[0-9a-f]+", "$1-HASH");
128+
// The order of the `/deps` directory flag is flaky
129+
config.stderr_filter("/deps", "");
130+
config.stderr_filter(
131+
&std::path::Path::new(file!())
132+
.parent()
133+
.unwrap()
134+
.canonicalize()
135+
.unwrap()
136+
.parent()
137+
.unwrap()
138+
.display()
139+
.to_string(),
140+
"$$DIR",
141+
);
142+
config.stderr_filter("[0-9a-f]+\\.rmeta", "$$HASH.rmeta");
143+
config.stderr_filter(r#"(panic.*)\.rs:[0-9]+:[0-9]+"#, "$1.rs");
144+
config.stderr_filter("failed to parse rustc version info.*", "");
145+
123146
ui_test::run_tests_generic(config, |path| path.ends_with("Cargo.toml")).unwrap();
124147
}
125148

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
error: unexpected argument '--out-dir' found
1+
Checking cargo_common_metadata_fail v0.1.0 ($DIR/$DIR)
2+
warning: package `cargo_common_metadata_fail` is missing `package.description` metadata
3+
|
4+
note: the lint level is defined here
5+
--> src/main.rs:2:9
6+
|
7+
2 | #![warn(clippy::cargo_common_metadata)]
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29

3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
10+
warning: package `cargo_common_metadata_fail` is missing `either package.license or package.license_file` metadata
411

5-
For more information, try '--help'.
12+
warning: package `cargo_common_metadata_fail` is missing `package.repository` metadata
13+
14+
warning: package `cargo_common_metadata_fail` is missing `package.readme` metadata
15+
16+
warning: package `cargo_common_metadata_fail` is missing `package.keywords` metadata
17+
18+
warning: package `cargo_common_metadata_fail` is missing `package.categories` metadata
19+
20+
warning: `cargo_common_metadata_fail` (bin "cargo_common_metadata_fail") generated 6 warnings
21+
Finished dev [unoptimized + debuginfo] target(s)
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
error: unexpected argument '--out-dir' found
1+
Checking cargo_common_metadata_fail_publish v0.1.0 ($DIR/$DIR)
2+
warning: package `cargo_common_metadata_fail_publish` is missing `package.description` metadata
3+
|
4+
note: the lint level is defined here
5+
--> src/main.rs:2:9
6+
|
7+
2 | #![warn(clippy::cargo_common_metadata)]
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29

3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
10+
warning: package `cargo_common_metadata_fail_publish` is missing `either package.license or package.license_file` metadata
411

5-
For more information, try '--help'.
12+
warning: package `cargo_common_metadata_fail_publish` is missing `package.repository` metadata
13+
14+
warning: package `cargo_common_metadata_fail_publish` is missing `package.readme` metadata
15+
16+
warning: package `cargo_common_metadata_fail_publish` is missing `package.keywords` metadata
17+
18+
warning: package `cargo_common_metadata_fail_publish` is missing `package.categories` metadata
19+
20+
warning: `cargo_common_metadata_fail_publish` (bin "cargo_common_metadata_fail_publish") generated 6 warnings
21+
Finished dev [unoptimized + debuginfo] target(s)
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
error: unexpected argument '--out-dir' found
1+
Checking cargo_common_metadata_fail_publish_true v0.1.0 ($DIR/$DIR)
2+
warning: package `cargo_common_metadata_fail_publish_true` is missing `package.description` metadata
3+
|
4+
note: the lint level is defined here
5+
--> src/main.rs:2:9
6+
|
7+
2 | #![warn(clippy::cargo_common_metadata)]
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29

3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
10+
warning: package `cargo_common_metadata_fail_publish_true` is missing `either package.license or package.license_file` metadata
411

5-
For more information, try '--help'.
12+
warning: package `cargo_common_metadata_fail_publish_true` is missing `package.repository` metadata
13+
14+
warning: package `cargo_common_metadata_fail_publish_true` is missing `package.readme` metadata
15+
16+
warning: package `cargo_common_metadata_fail_publish_true` is missing `package.keywords` metadata
17+
18+
warning: package `cargo_common_metadata_fail_publish_true` is missing `package.categories` metadata
19+
20+
warning: `cargo_common_metadata_fail_publish_true` (bin "cargo_common_metadata_fail_publish_true") generated 6 warnings
21+
Finished dev [unoptimized + debuginfo] target(s)
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
error: unexpected argument '--out-dir' found
2-
3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
4-
5-
For more information, try '--help'.
1+
Checking cargo_common_metadata_pass v0.1.0 ($DIR/$DIR)
2+
Finished dev [unoptimized + debuginfo] target(s)
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
error: unexpected argument '--out-dir' found
2-
3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
4-
5-
For more information, try '--help'.
1+
Checking cargo_common_metadata_pass_publish_empty v0.1.0 ($DIR/$DIR)
2+
Finished dev [unoptimized + debuginfo] target(s)
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
error: unexpected argument '--out-dir' found
2-
3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
4-
5-
For more information, try '--help'.
1+
Checking cargo_common_metadata_pass_publish_false v0.1.0 ($DIR/$DIR)
2+
Finished dev [unoptimized + debuginfo] target(s)
Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
error: unexpected argument '--out-dir' found
1+
Checking fail-both-diff v0.1.0 ($DIR/$DIR)
2+
warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.59.0` from `clippy.toml`
23

3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
4+
error: unnecessary structure name repetition
5+
--> src/main.rs:6:21
6+
|
7+
6 | pub fn bar() -> Foo {
8+
| ^^^ help: use the applicable keyword: `Self`
9+
|
10+
note: the lint level is defined here
11+
--> src/main.rs:1:9
12+
|
13+
1 | #![deny(clippy::use_self)]
14+
| ^^^^^^^^^^^^^^^^
415

5-
For more information, try '--help'.
16+
error: unnecessary structure name repetition
17+
--> src/main.rs:7:9
18+
|
19+
7 | Foo
20+
| ^^^ help: use the applicable keyword: `Self`
21+
22+
warning: `fail-both-diff` (bin "fail-both-diff") generated 1 warning
23+
error: could not compile `fail-both-diff` due to 2 previous errors; 1 warning emitted
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
error: unexpected argument '--out-dir' found
1+
Checking fail-both-same v0.1.0 ($DIR/$DIR)
2+
error: unnecessary structure name repetition
3+
--> src/main.rs:6:21
4+
|
5+
6 | pub fn bar() -> Foo {
6+
| ^^^ help: use the applicable keyword: `Self`
7+
|
8+
note: the lint level is defined here
9+
--> src/main.rs:1:9
10+
|
11+
1 | #![deny(clippy::use_self)]
12+
| ^^^^^^^^^^^^^^^^
213

3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
14+
error: unnecessary structure name repetition
15+
--> src/main.rs:7:9
16+
|
17+
7 | Foo
18+
| ^^^ help: use the applicable keyword: `Self`
419

5-
For more information, try '--help'.
20+
error: could not compile `fail-both-same` due to 2 previous errors
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
error: unexpected argument '--out-dir' found
1+
Checking fail-cargo v0.1.0 ($DIR/$DIR)
2+
error: unnecessary structure name repetition
3+
--> src/main.rs:6:21
4+
|
5+
6 | pub fn bar() -> Foo {
6+
| ^^^ help: use the applicable keyword: `Self`
7+
|
8+
note: the lint level is defined here
9+
--> src/main.rs:1:9
10+
|
11+
1 | #![deny(clippy::use_self)]
12+
| ^^^^^^^^^^^^^^^^
213

3-
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
14+
error: unnecessary structure name repetition
15+
--> src/main.rs:7:9
16+
|
17+
7 | Foo
18+
| ^^^ help: use the applicable keyword: `Self`
419

5-
For more information, try '--help'.
20+
error: could not compile `fail-cargo` due to 2 previous errors

0 commit comments

Comments
 (0)