rust/src/test/ui
2017-05-13 17:42:59 +03:00
..
borrowck Point at variable moved by closure 2017-04-25 22:03:05 -07:00
check_match Improve error message, fix and add tests. 2017-01-03 15:33:31 +08:00
codemap_tests Move 'coherence-overlapping-inherent-impl-trait' test to ui 2017-04-04 21:08:56 +09:00
compare-method Reduce visual clutter of multiline start when possible 2017-04-20 17:31:20 -07:00
cross-crate-macro-backtrace Fix wording for out-of-crate macro error 2016-09-15 10:12:56 -07:00
did_you_mean Update the .stderr file for the "an" changes 2017-05-06 18:49:01 +02:00
dropck Reduce visual clutter of multiline start when possible 2017-04-20 17:31:20 -07: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
impl-trait Explicit help message for binop type missmatch 2017-04-10 14:28:38 -07:00
invalid-module-declaration Add ui tests 2017-04-25 12:21:28 +02:00
issue-37311-type-length-limit Reduce visual clutter of multiline start when possible 2017-04-20 17:31:20 -07:00
issue-40402-ref-hints Using a span_suggestion to display use & hint 2017-05-02 05:44:55 -07:00
issue-41652 Fix issue #41652. 2017-05-03 13:00:33 +08:00
lifetime-errors rustc: use DefId instead of CodeExtent for FreeRegion's scope. 2017-05-13 17:42:59 +03: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 Group "macro expansion" notes per call span 2017-05-06 00:55:42 -07:00
mismatched_types Move cfail tests to ui 2017-04-25 17:17:12 -07:00
missing-items Reduce visual clutter of multiline start when possible 2017-04-20 17:31:20 -07:00
print-fuel UI test for -Z print-fuel=foo 2017-04-11 14:36:08 +03:00
print_type_sizes Added feature gate, updated error messages and tests. 2017-04-21 07:37:10 +10:00
pub Rebase and address comments 2017-04-25 13:35:04 +02:00
reachable cherry-pick over the tests I wrote for the reachability code 2017-03-30 07:55:29 -04:00
resolve Example usage of multiple suggestions 2017-05-10 13:20:27 +02:00
span Example usage of multiple suggestions 2017-05-10 13:20:27 +02:00
suggestions Rebase and address comments 2017-04-25 13:35:04 +02:00
token libsyntax/parse: improve associated item error reporting 2017-04-17 21:25:35 +03:00
type-check Reduce visual clutter of multiline start when possible 2017-04-20 17:31:20 -07:00
coercion-missing-tail-expected-type.rs Fix error message for mismatched types 2017-04-25 18:28:08 -04:00
coercion-missing-tail-expected-type.stderr Fix error message label 2017-04-28 18:01:06 -04:00
loop-break-value-no-repeat.rs rework how we handle the type of loops 2017-03-30 07:55:29 -04:00
loop-break-value-no-repeat.stderr rework how we handle the type of loops 2017-03-30 07:55:29 -04: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
static-lifetime.rs Improve E0477 error message 2017-05-09 20:51:18 +02:00
static-lifetime.stderr Improve E0477 error message 2017-05-09 20:51:18 +02: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)