rust/src/test/ui
Corey Farwell e32e2d47d0 Rollup merge of #39602 - estebank:fix-39544, r=eddyb
Fix ICE when accessing mutably an immutable enum

Fix #39544.
2017-02-09 08:47:34 -05:00
..
check_match Improve error message, fix and add tests. 2017-01-03 15:33:31 +08:00
codemap_tests Add a new ui test and update existing ones 2017-02-04 16:25:56 -05:00
compare-method note individual lint name set via lint group attribute in notes 2017-02-04 10:44:22 -08:00
cross-crate-macro-backtrace Fix wording for out-of-crate macro error 2016-09-15 10:12:56 -07:00
custom-derive Move derive macro expansion into the MacroExpander 2017-02-05 09:31:02 +10:30
did_you_mean Fix ICE when accessing mutably an immutable enum 2017-02-06 16:59:23 -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 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 rustc: Remove all "consider using an explicit lifetime parameter" suggestions 2017-01-26 22:11:29 +00:00
lint note wording: lint implied by lint group, not lint group implies lint 2017-02-04 10:51:11 -08:00
macros resolve: Do not use "resolve"/"resolution" in error messages 2017-01-12 10:08:27 +03:00
mismatched_types Merge ty::TyBox into ty::TyAdt 2017-01-30 23:14:15 +03:00
missing-items Add a new ui test and update existing ones 2017-02-04 16:25:56 -05:00
print_type_sizes Disable field reordering 2016-12-21 19:57:29 -05:00
resolve Improve diagnostics for inaccessible constructors 2017-01-29 02:57:14 +03:00
span note wording: lint implied by lint group, not lint group implies lint 2017-02-04 10:51:11 -08:00
README.md add UI testing framework 2016-05-13 15:22:45 -07:00
regions-fn-subtyping-return-static.rs make lifetimes that only appear in return type early-bound 2017-02-05 16:30:03 -05:00
regions-fn-subtyping-return-static.stderr make lifetimes that only appear in return type early-bound 2017-02-05 16:30:03 -05: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)