summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorNadrieril2020-02-09 18:29:13 +0000
committerNadrieril2020-02-09 19:58:28 +0000
commit5d0f37d89f23512c2676b1f2d0235f25269c53ab (patch)
treef0995e691e7c97ed85f9408aca7a48d1b44b1f70 /README.md
parent8abb6c24cd26b64d708a74faaa28cc9294dc3466 (diff)
Add option to overwrite test files
Diffstat (limited to '')
-rw-r--r--README.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/README.md b/README.md
index 2c6c5c7..aa5cc61 100644
--- a/README.md
+++ b/README.md
@@ -124,8 +124,39 @@ $ cargo build
$ cargo test
```
+You can also run tests individually by their name:
+
+```bash
+$ cargo test tests::spec::name_of_test
+```
+
Now we can have fun and happy contributing!
+## Test suite
+
+The test suite uses tests from the dhall-lang submodule as well as from the
+local `dhall/tests` directory.
+The various tests are run according to the instructions present in
+[`dhall-lang/tests/README.md`](https://github.com/dhall-lang/dhall-lang/blob/master/tests/README.md).
+
+If an output test file (a `fooB.dhall` file) is missing, we will generate it automatically.
+This is useful when writing new tests. Don't forget to commit it to git !
+
+If a test fails but you prefer the new output, you can run the test with
+`UPDATE_TEST_FILES=1` to overwrite the result file with the new output.
+This happens often with ui tests (see below), since we may want to change the
+phrasing of errors for example.
+
+```bash
+$ UPDATE_TEST_FILES=1 cargo test tests::spec::name_of_test
+```
+
+In addition to the usual dhall tests, we additionally run "ui tests", that
+ensure that the output of the various errors stays good.
+The output of the ui tests is stored in the local `dhall/tests` directory, even
+for the tests coming from dhall-lang. They are stored in a `.txt` file with the
+same name as the corresponding test.
+
## Changelog
- 0.2.1: Improve documentation and deserialize many more types