rust/src/test/ui
Alex Crichton f1852650d9 Rollup merge of #39168 - estebank:multiline-candidate, r=petrochenkov
Use multiline Diagnostic for candidate in other module

```
error[E0574]: expected struct, variant or union type, found enum `Result`
  --> $DIR/issue-16058.rs:19:9
   |
19 |         Result {
   |         ^^^^^^ not a struct, variant or union type
   |
   = help: possible better candidates are found in other modules, you can import them into scope:
             `use std::fmt::Result;`
             `use std::io::Result;`
             `use std:🧵:Result;`

error: aborting due to previous error
```
2017-01-20 08:35:49 -08:00
..
check_match Improve error message, fix and add tests. 2017-01-03 15:33:31 +08:00
codemap_tests calling convention for MSP430 interrupts 2017-01-18 20:42:54 -05:00
compare-method Teach Diagnostics to highlight text 2017-01-17 14:28:53 -08:00
cross-crate-macro-backtrace Fix wording for out-of-crate macro error 2016-09-15 10:12:56 -07:00
custom-derive Test for appropriate span on second custom derive 2017-01-06 18:17:34 -08:00
did_you_mean Use multiline Diagnostic for "relevant impl" list 2017-01-13 11:40:44 -08:00
dropck review comments 2016-11-23 23:44:17 -08:00
fmt On fmt string with unescaped { note how to escape 2016-11-11 10:53:02 -08:00
hello_world
issue-37311-type-length-limit limit the length of types in monomorphization 2016-12-02 00:54:22 +02:00
lifetimes review comments 2016-11-23 23:44:17 -08:00
macros resolve: Do not use "resolve"/"resolution" in error messages 2017-01-12 10:08:27 +03:00
mismatched_types Teach Diagnostics to highlight text 2017-01-17 14:28:53 -08:00
missing-items Add UI test for missing type parameter 2016-12-09 18:23:05 -08:00
print_type_sizes Disable field reordering 2016-12-21 19:57:29 -05:00
resolve Rollup merge of #39168 - estebank:multiline-candidate, r=petrochenkov 2017-01-20 08:35:49 -08:00
span Rollup merge of #39168 - estebank:multiline-candidate, r=petrochenkov 2017-01-20 08:35:49 -08:00
README.md
update-all-references.sh pacify the mercilous tidy 2016-05-16 16:48:48 -04:00
update-references.sh cleanup error reporting and add ui tests 2016-11-01 14:04:14 -04:00

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)