rust/src/test/ui
Mark Simulacrum 2945642901 Rollup merge of #42062 - fhartwig:fix-off-by-one-span, r=nikomatsakis
Fix off-by-one error in column number in `explain_span`.

Fixes #41938
2017-05-20 17:48:12 -06:00
..
borrowck
check_match
codemap_tests
compare-method
cross-crate-macro-backtrace
did_you_mean Update the .stderr file for the "an" changes 2017-05-06 18:49:01 +02:00
dropck
fmt
hello_world
impl-trait
invalid-module-declaration
issue-37311-type-length-limit
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 Fix off-by-one error in column number in explain_span. 2017-05-18 00:21:57 +02:00
lifetimes
lint
macros Group "macro expansion" notes per call span 2017-05-06 00:55:42 -07:00
mismatched_types Make unsatisfied trait bounds note multiline 2017-05-14 20:38:26 -07:00
missing-items
print_type_sizes
print-fuel
pub
reachable
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
token
type-check
coercion-missing-tail-expected-type.rs
coercion-missing-tail-expected-type.stderr Fix error message label 2017-04-28 18:01:06 -04:00
fn_once-moved.rs Add help message if a FnOnce is moved 2017-05-18 21:29:04 +02:00
fn_once-moved.stderr Add help message if a FnOnce is moved 2017-05-18 21:29:04 +02:00
loop-break-value-no-repeat.rs
loop-break-value-no-repeat.stderr
README.md
regions-fn-subtyping-return-static.rs
regions-fn-subtyping-return-static.stderr
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
update-references.sh

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)