rust/src/test/ui
Guillaume Gomez f17bdb7eec Rollup merge of #36498 - jonathandturner:macro_std_lib, r=nikomatsakis
Fix wording for out-of-crate macro error

This fixes the wording of the note for out-of-crate macro errors to fix https://github.com/rust-lang/rust/issues/36469

The previous wording came from older logic in the PR that was replaced without updating the note.
2016-09-24 00:15:44 +02:00
..
codemap_tests Fix wording for out-of-crate macro error 2016-09-15 10:12:56 -07:00
cross-crate-macro-backtrace Fix wording for out-of-crate macro error 2016-09-15 10:12:56 -07:00
hello_world add UI testing framework 2016-05-13 15:22:45 -07:00
lifetimes Update error message for lifetime of borrowed values 2016-08-31 17:48:26 -07:00
macros Replace local backtrace with def-use, repair std macro spans 2016-08-17 14:26:14 -07:00
mismatched_types Specify when type parameter shadows primitive type 2016-09-15 20:06:29 -07:00
span fix top level attr spans 2016-09-16 21:44:15 +03: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 pacify the mercilous tidy 2016-05-16 16:48:48 -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)