summaryrefslogtreecommitdiff
path: root/tests/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'tests/README.md')
-rw-r--r--tests/README.md35
1 files changed, 13 insertions, 22 deletions
diff --git a/tests/README.md b/tests/README.md
index 5334c271..fb755f1b 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -1,5 +1,14 @@
# Tests
+## Directory structure
+Top level directory structure:
+- `typ`: Input files.
+- `ref`: Reference images which the output is compared with to determine whether
+ a test passed or failed.
+- `png`: PNG files produced by tests.
+- `pdf`: PDF files produced by tests.
+- `res`: Resource files used by tests.
+
## Running the tests
```bash
# Run all tests
@@ -11,34 +20,16 @@ cargo test --lib
# Run integration tests (the tests in this directory)
cargo test --test typeset
-# Run all tests whose names contain a filter word
-cargo test --test typeset call
-```
-
-For experimenting it's often useful to have a test file you can quickly run. For that purpose you can have a file named `playground.typ` right in this directory (the file is ignored by git). The playground test will be executed whenever no other test matches the filter, so you can run it with (since no real test's name contains an underscore):
-```bash
-cargo test --test typeset _
+# Run all tests whose names contain the word `filter`
+cargo test --test typeset filter
```
-## Directory structure
-Top level directory structure:
-- `full`: Tests of full documents.
-- `lang`: Tests for specific language features.
-- `library`: Tests for specific library functions.
-- `res`: Resource files used by tests.
-
-Directory structure for each category:
-- `typ`: Input files.
-- `ref`: Reference images which the output is compared with to determine whether
- a test passed or failed.
-- `png`: PNG files produced by tests.
-- `pdf`: PDF files produced by tests.
-
+## Creating new tests
To keep things small, please optimize reference images before committing them:
```bash
# One image
oxipng -o max path/to/image.png
# All images
-oxipng -r -o max tests/*/ref
+oxipng -r -o max tests/ref
```