Skip to content

Commit fa62a0c

Browse files
committed
Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.
The 'run-pass' header cause a 'ui' test to execute the result. It is used to test the lint output, at the same time ensure those lints won't cause the source code to become compile-fail. 12 run-pass/run-pass-fulldeps tests gained the header and are moved to ui/ui-fulldeps. After this move, no run-pass/run-pass-fulldeps tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing #36516.
1 parent 9fa25a7 commit fa62a0c

28 files changed

+212
-5
lines changed

src/test/run-pass-fulldeps/deprecated-derive.rs renamed to src/test/ui-fulldeps/deprecated-derive.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// run-pass
12+
1113
#![feature(rustc_private)]
1214
#![allow(dead_code)]
1315

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
warning: derive(Encodable) is deprecated in favor of derive(RustcEncodable)
2+
--> $DIR/deprecated-derive.rs:18:10
3+
|
4+
18 | #[derive(Encodable)]
5+
| ^^^^^^^^^
6+

src/test/run-pass-fulldeps/lint-group-plugin.rs renamed to src/test/ui-fulldeps/lint-group-plugin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// run-pass
1112
// aux-build:lint_group_plugin_test.rs
1213
// ignore-stage1
1314
#![feature(plugin)]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
warning: item is named 'lintme'
2+
--> $DIR/lint-group-plugin.rs:18:1
3+
|
4+
18 | fn lintme() { } //~ WARNING item is named 'lintme'
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: #[warn(test_lint)] on by default
8+
9+
warning: item is named 'pleaselintme'
10+
--> $DIR/lint-group-plugin.rs:19:1
11+
|
12+
19 | fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
13+
| ^^^^^^^^^^^^^^^^^^^^^
14+
|
15+
= note: #[warn(please_lint)] on by default
16+

src/test/run-pass-fulldeps/lint-plugin-cmdline-allow.rs renamed to src/test/ui-fulldeps/lint-plugin-cmdline-allow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// run-pass
1112
// aux-build:lint_plugin_test.rs
1213
// ignore-stage1
1314
// compile-flags: -A test-lint
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: function is never used: `lintme`
2+
--> $DIR/lint-plugin-cmdline-allow.rs:19:1
3+
|
4+
19 | fn lintme() { }
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: #[warn(dead_code)] on by default
8+

src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs renamed to src/test/ui-fulldeps/lint-plugin-cmdline-load.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// run-pass
1112
// aux-build:lint_plugin_test.rs
1213
// ignore-stage1
1314
// compile-flags: -Z extra-plugins=lint_plugin_test
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: item is named 'lintme'
2+
--> $DIR/lint-plugin-cmdline-load.rs:18:1
3+
|
4+
18 | fn lintme() { } //~ WARNING item is named 'lintme'
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: #[warn(test_lint)] on by default
8+

0 commit comments

Comments
 (0)