From 4412b726d2aab5427539205846a88a383c34aa4e Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 23 May 2018 11:55:16 +0200 Subject: [PATCH 1/4] Fixes #141 --- src/tests/adding.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/tests/adding.md b/src/tests/adding.md index 96fc0cf8..16e4982b 100644 --- a/src/tests/adding.md +++ b/src/tests/adding.md @@ -266,13 +266,16 @@ you can even run the resulting program. Just add one of the following ### 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 `ui/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 -`ui/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 `ui/update-all-references.sh`. In both cases, you can run -the script with `--help` to get a help message. +making a new test, you can pass `--bless` to the test subcommand. E.g. +if some tests in `src/test/ui` are failing, you can run + +``` +./x.py test --stage 1 src/test/ui --bless +``` + +to automatically adjust the `.stderr`, `.stdout` or `.fixed` files of +all tests. Of course you can also target just specific tests with the +`--test-args your_test_name` flag, just like when running the tests. ### Normalization From e25515fa7ccaafd3df92a292ea55a0a1b95c3a18 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 28 May 2018 13:08:15 +0200 Subject: [PATCH 2/4] Mention "run-rustfix" --- src/tests/adding.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tests/adding.md b/src/tests/adding.md index 16e4982b..e8075e53 100644 --- a/src/tests/adding.md +++ b/src/tests/adding.md @@ -148,6 +148,9 @@ exhaustive. Header commands can generally be found by browsing the `TestProps` structure found in [`header.rs`] from the compiletest source. +* `run-rustfix` for UI tests, indicates that the test produces + structured suggestions, which are then applied and the final + source is compiled again. * `min-{gdb,lldb}-version` * `min-llvm-version` * `compile-pass` for UI tests, indicates that the test is From 86f694c1d406653ced1bbb2b321492bf3fb89269 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 29 May 2018 15:37:24 +0200 Subject: [PATCH 3/4] Explain .fixed files --- src/tests/adding.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/adding.md b/src/tests/adding.md index e8075e53..daaaace7 100644 --- a/src/tests/adding.md +++ b/src/tests/adding.md @@ -150,7 +150,8 @@ source. * `run-rustfix` for UI tests, indicates that the test produces structured suggestions, which are then applied and the final - source is compiled again. + source is stored in a `.fixed` file and compiled again. The final + compilation is required to succeed. * `min-{gdb,lldb}-version` * `min-llvm-version` * `compile-pass` for UI tests, indicates that the test is From 053060c44242faf969cea1d231fa694bdbeb0d0a Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 29 May 2018 16:31:32 +0200 Subject: [PATCH 4/4] Satisfy travis --- src/tests/adding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/adding.md b/src/tests/adding.md index daaaace7..3788e7c4 100644 --- a/src/tests/adding.md +++ b/src/tests/adding.md @@ -273,7 +273,7 @@ If you have changed the compiler's output intentionally, or you are making a new test, you can pass `--bless` to the test subcommand. E.g. if some tests in `src/test/ui` are failing, you can run -``` +```text ./x.py test --stage 1 src/test/ui --bless ```