summaryrefslogtreecommitdiff
path: root/tests/README.md
blob: fb755f1bf7c482c8581949c669641aac71af17cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 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
cargo test

# Run unit tests
cargo test --lib

# Run integration tests (the tests in this directory)
cargo test --test typeset

# Run all tests whose names contain the word `filter`
cargo test --test typeset filter
```

## 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
```