summaryrefslogtreecommitdiff
path: root/tests/ui
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-02-10 14:33:31 +0000
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-02-16 19:40:23 +0000
commite53d6dd35bb38b81dff4b00497f4c152e9009499 (patch)
treef97c2cd49d3d3b54b330c1e955c8cc7dba14f7ce /tests/ui
parentd2e8ecd8bd26a22111cdebfb813258450b07fbf0 (diff)
Implement infra support for migrating from `//` to `//@` ui test directives
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/README.md35
-rw-r--r--tests/ui/symbol-names/x86-stdcall.rs1
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/ui/README.md b/tests/ui/README.md
new file mode 100644
index 00000000000..c14d0ee78c8
--- /dev/null
+++ b/tests/ui/README.md
@@ -0,0 +1,35 @@
+# UI Tests
+
+This folder contains `rustc`'s
+[UI tests](https://rustc-dev-guide.rust-lang.org/tests/ui.html).
+
+## Test Directives (Headers)
+
+Typically, a UI test will have some test directives / headers which are
+special comments that tell compiletest how to build and intepret a test.
+
+As part of an on-going effort to rewrite compiletest
+(see <https://github.com/rust-lang/compiler-team/issues/536>), a major
+change proposal to change legacy compiletest-style headers `// <directive>`
+to [`ui_test`](https://github.com/oli-obk/ui_test)-style headers
+`//@ <directive>` was accepted (see
+<https://github.com/rust-lang/compiler-team/issues/512>.
+
+An example directive is `ignore-test`. In legacy compiletest style, the header
+would be written as
+
+```rs
+// ignore-test
+```
+
+but in `ui_test` style, the header would be written as
+
+```rs
+//@ ignore-test
+```
+
+compiletest is changed to accept only `//@` directives for UI tests
+(currently), and will reject and report an error if it encounters any
+comments `// <content>` that may be parsed as an legacy compiletest-style
+test header. To fix this, you should migrate to the `ui_test`-style header
+`//@ <content>`.
diff --git a/tests/ui/symbol-names/x86-stdcall.rs b/tests/ui/symbol-names/x86-stdcall.rs
index 43c086dc6bc..c0cb42023a1 100644
--- a/tests/ui/symbol-names/x86-stdcall.rs
+++ b/tests/ui/symbol-names/x86-stdcall.rs
@@ -1,3 +1,4 @@
+// ignore-tidy-linelength
// build-pass
// only-x86
// only-windows