[lltx] fontspec test suite

Manuel Pégourié-Gonnard mpg at elzevir.fr
Fri Jun 4 16:04:33 CEST 2010


Le 04/06/2010 15:18, Will Robertson a écrit :
> I've now added a test suite to fontspec. It currently contains no tests :) --
> besides some examples. Please try it out! You'll need ImageMagick and an
> environment that can deal with Makefiles and so on. (I *think* all TeX
> distributions come with ImageMagick these days, but I might be wrong.)
> 
TL doesn't come with ImageMagick (it is an addition of MacTeX on the Mac), but I
still think this tool is pretty standard. After all, TL doesn't come with GNU
make either :-)

> The only step required, I hope, is to run `make check` after you've grabbed
> the files from <http://github.com/wspr/fontspec>. Now that I mention it, you
> might need to manually create a build/ directory.
> 
Yep, we need to create it. You'll probably add mkdir -p build in a next version.

> (a) if the test suite actually functions (my shell scripting isn't so hot)

Atm, I've got two problems:
- my shell's test command (aka [) doesn't seem to like '=='. Since I don't see
it listed on [1], I assume it's better to use '='. Also, as a general rule, it
is safer to prepend something to the strings being tested, like

test "x$a" = "x$b"

so as to avoid problems with strings starting with special symbols, as well as
empty strings.

[1]: http://www.opengroup.org/onlinepubs/009695399/utilities/test.html

- I'm afraid the second problem is more serious: my compare command doesn't
include the string "dB" in its output:

mpg at roth:~/tex/packages/fontspec% compare -metric ae -fuzz 10% build/F001a-L.pdf
testsuite/F001a.safe.pdf build/F001a.diff.pdf
0
mpg at roth:~/tex/packages/fontspec% compare -metric ae build/F001a-L.pdf
testsuite/F001a.safe.pdf build/F001a.diff.pdf
3

which make your grep fail on the output fail. Probably a version issue?

mpg at roth:~/tex/packages/fontspec% compare --version                      (test)
Version: ImageMagick 6.6.0-4 2010-03-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

> (b) if the test suite actually passes (rounding errors might be too large)
> 
I was too lazy to modify the Makefile to make the suite run, so I don't know if
it passes.

> If (b) doesn't work, then I'll remove the ".safe.pdf" files from the
> repository, and the test suite can be used simply as a regression suite for
> each developer.
> 
Or maybe we can combine both modes: ship the .safe.pdf files (I think they are
valuable) and allow a (local) regression-testing mode. It should be doable by
adjusting the location of the reference files depending on the target.

Manuel.


More information about the lualatex-dev mailing list