Skip to content

Commit 1b5a923

Browse files
committed
Auto merge of #41968 - kennytm:fix-unreadable-json-test-output-36516, r=nikomatsakis
Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. <del>`ui-run` test is a combination of `ui` test and `run-pass` test. It is used to test lint output.</del> Added support of `// run-pass` header to `ui` tests. The compiler message of each test must match the corresponding `*.stderr` file like the traditional `ui` tests. Additionally, the compiled output must be executed successfully like the `run-pass` test. 12 `run-pass`/`run-pass-fulldeps` tests are moved to `ui`/`ui-fulldeps` plus the headers. 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.
2 parents efee86d + 3e6c83d commit 1b5a923

30 files changed

+250
-35
lines changed

src/test/codegen/fastcall-inreg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// ignore-tce
3838
// ignore-thumb
3939
// ignore-thumbeb
40-
// ignore-x86_64 no-ignore-x86
40+
// ignore-x86_64
4141
// ignore-xcore
4242
// ignore-nvptx
4343
// ignore-nvptx64

src/test/run-pass/i128-ffi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
// ignore-windows
1616

1717
// Ignore 32 bit targets:
18-
// ignore-x86, ignore-arm
18+
// ignore-x86
19+
// ignore-arm
1920

2021
// ignore-emscripten
2122

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+

0 commit comments

Comments
 (0)