rust/src/test/ui
Alex Crichton 2f4ca4e2df Rollup merge of #38245 - estebank:cast-deref-hint-2, r=nikomatsakis
When cast needs a dereference point at full cast

After the fix of #37453 in PR #37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference, as well as assign the error label to the correct span for proper coloring:

<img width="471" alt="error span pointing at the entire cast" src="https://cloud.githubusercontent.com/assets/1606434/21024245/8797fc2e-bd38-11e6-82c1-66c281c656c1.png">

instead of

<img width="471" alt="error span pointing at the type of the cast" src="https://cloud.githubusercontent.com/assets/1606434/21023777/d4814aa6-bd36-11e6-9fc3-b2a0ea5ee15d.png">

Move `compile-fail` test to `ui` test.
2016-12-20 11:16:29 -08:00
..
check_match un-break the construct_witness logic 2016-10-26 22:41:17 +03:00
codemap_tests Update error expectations 2016-12-03 17:12:31 -08:00
compare-method Show multiline spans in full if short enough 2016-11-22 13:42:36 -08:00
cross-crate-macro-backtrace Fix wording for out-of-crate macro error 2016-09-15 10:12:56 -07:00
did_you_mean Fix invalid "ref mut mut" sugestion 2016-11-03 20:59:03 -07: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 add UI testing framework 2016-05-13 15:22:45 -07:00
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 Allow path fragments to be parsed as type parameter bounds in macro expansion 2016-12-16 14:16:46 +03:00
mismatched_types When cast needs a dereference point at full cast 2016-12-14 17:33:03 -08:00
missing-items Add UI test for missing type parameter 2016-12-09 18:23:05 -08:00
print_type_sizes Fix -Z print-type-sizes and tests. 2016-12-14 12:28:25 -05:00
span Auto merge of #38121 - jonathandturner:better_e0061, r=nikomatsakis 2016-12-06 00:17:24 +00:00
README.md add UI testing framework 2016-05-13 15:22:45 -07:00
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)