Skip to content

Commit 77435f9

Browse files
committed
Auto merge of #3748 - phansch:uitest, r=oli-obk
Add a uitest subcommand to simplify UI test invocation This makes running single tests a lot easier. It's now `TESTNAME=xxx cargo uitest` instead of `TESTNAME=xxx cargo test --test compile-test`
2 parents 35e2e1b + f934f98 commit 77435f9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
uitest = "test --test compile-test"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn main() {
101101
}
102102
```
103103

104-
Now you run `TESTNAME=ui/my_lint cargo test --test compile-test` to produce
104+
Now you run `TESTNAME=ui/my_lint cargo uitest` to produce
105105
a `.stdout` file with the generated code:
106106

107107
```rust
@@ -151,7 +151,7 @@ Use `cargo test` to run the whole testsuite.
151151
If you don't want to wait for all tests to finish, you can also execute a single test file by using `TESTNAME` to specify the test to run:
152152

153153
```bash
154-
TESTNAME=ui/empty_line_after_outer_attr cargo test --test compile-test
154+
TESTNAME=ui/empty_line_after_outer_attr cargo uitest
155155
```
156156

157157
Clippy uses UI tests. UI tests check that the output of the compiler is exactly as expected.

clippy_lints/src/utils/author.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::ast::{Attribute, LitKind, DUMMY_NODE_ID};
2525
/// }
2626
/// ```
2727
///
28-
/// Running `TESTNAME=ui/my_lint cargo test --test compile-test` will produce
28+
/// Running `TESTNAME=ui/my_lint cargo uitest` will produce
2929
/// a `./tests/ui/new_lint.stdout` file with the generated code:
3030
///
3131
/// ```rust

0 commit comments

Comments
 (0)