rust/src/test/ui
Alex Crichton c253eb23a6 Rollup merge of #40287 - estebank:label-overlap, r=nrc
Fix incorrect span label formatting

Fix #40157.
2017-03-10 16:18:28 -08:00
..
check_match Improve error message, fix and add tests. 2017-01-03 15:33:31 +08:00
codemap_tests Add support for x86-interrupt calling convention 2017-03-02 19:01:15 +01: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
did_you_mean Auto merge of #39655 - durka:recursion-limit-suggestion, r=nikomatsakis 2017-03-02 17:44:17 +00: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
lifetime-errors remove vestiges of the old suggestion machinery 2017-02-17 14:47:39 -05: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 improve error message when two-arg assert_eq! receives a trailing comma 2017-02-06 22:33:09 -08:00
mismatched_types Clean up "pattern doesn't bind x" messages 2017-03-06 00:20:26 -03:00
missing-items Fix ICE: don't use struct_variant on enums 2017-03-06 00:13:14 -03:00
print_type_sizes Disable field reordering 2016-12-21 19:57:29 -05:00
resolve rustc_const_eval: always demand typeck_tables for evaluating constants. 2017-02-25 18:35:26 +02:00
span Rollup merge of #40287 - estebank:label-overlap, r=nrc 2017-03-10 16:18:28 -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)