diff --git a/tests/README.md b/tests/README.md index 942fa88..c2ff786 100644 --- a/tests/README.md +++ b/tests/README.md @@ -4,15 +4,17 @@ You need to have `fonttools 4.50` installed on your system and in your PATH. Note that you need to have that exact version, otherwise the tests will fail. +In addition to that, you need Java installed on your system, install the [CFF dump utility](https://github.com/janpe2/CFFDump/releases/tag/v1.3.0) and point the `CFF_DUMP_BIN` environment variable to it. + ## Generating tests -In order to create new fonttools tests, you can edit `data/fonttools.tests`. For subset tests, you can edit -`data/subsets.tests` +In order to create new fonttools tests, you can edit `data/fonttools.tests`. +For CFF tests, you can edit `data/cff.tests`. For subset tests, you can edit `data/subsets.tests` In order to generate the tests, run `scripts/gen-tests.py`. ## Description Testing is very important, as having errors in the subsetting logic could have fatal consequences. -Because of this, we have three different testing approaches that cover 4 different +Because of this, we have four different testing approaches that cover 4 different font readers and 7 different PDF readers in total. ### Subset tests @@ -32,6 +34,12 @@ dump small subsets of fonts and compare the output to how fonttools would subset to identify other kinds of potential issues in the implementation. And it conveniently also allows us to have a fourth implementation to test against. +### CFF tests +A problem with CFF tests is that fonttools abstracts away the exact structure of the CFF table, +and stuff like the order of operators in DICTs as well as missing entries are not preserved. Because of +this, we use the above-mentioned CFF dump utility, which provides a much more detailed insight into the +structure of the CFF table, and allows us to detect regressions in CFF subsetting more easily. + ### Fuzzing tests In `examples`, we have a binary that takes an environment variable `FONT_DIR` and recursively iterates over all fonts in that directory and basically performs the same test as in #1, but on a randomly selected sets of glyphs. We currently