rust/src/test/ui
Esteban Küber 05d3526132 rustc_on_unimplemented supports referring to trait
Add support to `rustc_on_unimplemented` to reference the full path of
the annotated trait. For the following code:

```rust
pub mod Bar {
    #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"]
    pub trait Foo<Bar, Baz, Quux> {}
}
```

the error message will be:

```
test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
```
2017-07-05 16:46:59 -07:00
..
block-result report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
borrowck Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
check_match Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
closure_context report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
codemap_tests Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
compare-method Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
cross-crate-macro-backtrace Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
did_you_mean report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
dropck Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
fmt Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
hello_world
impl-trait report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
interior-mutability report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
invalid-module-declaration Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
issue-37311-type-length-limit Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
issue-38875 report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
issue-40402-ref-hints Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
issue-41652 Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
lifetime-errors report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
lifetimes Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
lint report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
macros Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
mismatched_types report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
missing-items report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
on-unimplemented rustc_on_unimplemented supports referring to trait 2017-07-05 16:46:59 -07:00
print_type_sizes
print-fuel
pub Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
reachable Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
resolve report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
span report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
suggestions Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
token Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
transmute report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
type-check report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
coercion-missing-tail-expected-type.rs Add test for #24889 2017-06-18 14:30:33 +02:00
coercion-missing-tail-expected-type.stderr report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
deprecated-macro_escape-inner.rs
deprecated-macro_escape-inner.stderr
deprecated-macro_escape.rs
deprecated-macro_escape.stderr
deriving-meta-empty-trait-list.rs
deriving-meta-empty-trait-list.stderr
enum-size-variance.rs
enum-size-variance.stderr
explain.rs Modify --explain to handle hidden code (# ...) and indented code blocks. 2017-06-23 15:31:53 +08:00
explain.stdout Modify --explain to handle hidden code (# ...) and indented code blocks. 2017-06-23 15:31:53 +08:00
issue-19100.rs
issue-19100.stderr
issue-22644.rs
issue-22644.stderr report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
issue-26548.rs
issue-26548.stderr report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
issue-33525.rs report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
issue-33525.stderr report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
loop-break-value-no-repeat.rs
loop-break-value-no-repeat.stderr Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
path-lookahead.rs
path-lookahead.stderr make lint on-by-default/implied-by messages appear only once 2017-06-26 16:10:06 -07:00
README.md
regions-fn-subtyping-return-static.rs
regions-fn-subtyping-return-static.stderr Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
shadowed-type-parameter.rs Move type parameter shadowing test to ui 2017-06-28 15:11:05 -07:00
shadowed-type-parameter.stderr report the total number of errors on compilation failure 2017-07-02 16:16:44 +03:00
static-lifetime.rs
static-lifetime.stderr Revert "Change error count messages" 2017-07-02 13:49:30 +03:00
test-should-panic-attr.rs
test-should-panic-attr.stderr
update-all-references.sh
update-references.sh

Guide to the UI Tests

The UI tests are intended to capture the compiler's complete output, so that we can test all aspects of the presentation. They work by compiling a file (e.g., hello_world/main.rs), capturing the output, and then applying some normalization (see below). This normalized result is then compared against reference files named hello_world/main.stderr and hello_world/main.stdout. If either of those files doesn't exist, the output must be empty. If the test run fails, we will print out the current output, but it is also saved in build/<target-triple>/test/ui/hello_world/main.stdout (this path is printed as part of the test failure mesage), so you can run diff and so forth.

Editing and updating the reference files

If you have changed the compiler's output intentionally, or you are making a new test, you can use the script update-references.sh to update the references. When you run the test framework, it will report various errors: in those errors is a command you can use to run the update-references.sh script, which will then copy over the files from the build directory and use them as the new reference. You can also just run update-all-references.sh. In both cases, you can run the script with --help to get a help message.

Normalization

The normalization applied is aimed at filenames:

  • the test directory is replaced with $DIR
  • all backslashes () are converted to forward slashes (/) (for windows)