rust/src/test/ui
Esteban Küber 4142d7bb89 Use callsite's span for macro calls on suggestion
When suggesting an appropriate mutability for a macro call, use the call
span instead of the expanded macro's span.
2017-05-31 23:48:19 -07:00
..
borrowck Change error count messages 2017-05-24 16:14:38 +07:00
check_match Change error count messages 2017-05-24 16:14:38 +07:00
codemap_tests Add invalid unary operator usage error code 2017-05-27 21:34:59 +02:00
compare-method Change error count messages 2017-05-24 16:14:38 +07:00
cross-crate-macro-backtrace Change error count messages 2017-05-24 16:14:38 +07:00
did_you_mean Add new error codes and update tests 2017-05-27 19:58:52 +02:00
dropck Add new error codes and update tests 2017-05-27 19:58:52 +02:00
fmt Change error count messages 2017-05-24 16:14:38 +07:00
hello_world
impl-trait tests: fix fallout from changing the span of binop errors. 2017-06-01 08:59:47 +03:00
invalid-module-declaration Change error count messages 2017-05-24 16:14:38 +07:00
issue-37311-type-length-limit Change error count messages 2017-05-24 16:14:38 +07:00
issue-40402-ref-hints Change error count messages 2017-05-24 16:14:38 +07:00
issue-41652 Add new error codes and update tests 2017-05-27 19:58:52 +02:00
lifetime-errors Change error count messages 2017-05-24 16:14:38 +07:00
lifetimes Add new error codes and update tests 2017-05-27 19:58:52 +02:00
lint Change error count messages 2017-05-24 16:14:38 +07:00
macros Auto merge of #42264 - GuillaumeGomez:new-error-codes, r=Susurrus 2017-05-29 21:55:57 +00:00
mismatched_types tests: fix fallout from changing the span of binop errors. 2017-06-01 08:59:47 +03:00
missing-items Add new error code 2017-05-30 19:19:34 +02:00
print_type_sizes Stabilize unions with Copy fields and no destructor 2017-05-27 00:52:20 +03:00
print-fuel UI test for -Z print-fuel=foo 2017-04-11 14:36:08 +03:00
pub Change error count messages 2017-05-24 16:14:38 +07:00
reachable Add invalid unary operator usage error code 2017-05-27 21:34:59 +02:00
resolve Add new error code 2017-05-30 19:19:34 +02:00
span Use callsite's span for macro calls on suggestion 2017-05-31 23:48:19 -07:00
suggestions Add new error codes and update tests 2017-05-27 19:58:52 +02:00
token Add new error code 2017-05-30 19:19:34 +02:00
type-check Change error count messages 2017-05-24 16:14:38 +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 Change error count messages 2017-05-24 16:14:38 +07:00
fn_once-moved.rs Update fn_once-moved test 2017-05-30 11:21:24 +01:00
fn_once-moved.stderr Rollup merge of #42196 - tommyip:explain_closure_err, r=nikomatsakis 2017-05-31 10:52:45 -06:00
loop-break-value-no-repeat.rs Stabilize the loop_break_value feature 2017-05-17 21:34:37 +02:00
loop-break-value-no-repeat.stderr Rollup merge of #42150 - citizen428:feature/error-count-messages, r=Mark-Simulacrum 2017-05-24 19:50:05 -06:00
README.md
regions-fn-subtyping-return-static.rs
regions-fn-subtyping-return-static.stderr Change error count messages 2017-05-24 16:14:38 +07:00
static-lifetime.rs Improve E0477 error message 2017-05-09 20:51:18 +02:00
static-lifetime.stderr Change error count messages 2017-05-24 16:14:38 +07: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)