| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: gkhuge.test 69812 2024-02-11 23:09:24Z karl $ |
| 3 |
# Copyright 2018 Karl Berry <[email protected]> |
| 4 |
# You may freely use, modify and/or distribute this file. |
| 5 |
|
| 6 |
BinDir=${BinDir:-.} |
| 7 |
ExeExt=${ExeExt:-} |
| 8 |
_uppltotf=$BinDir/uppltotf$ExeExt |
| 9 |
_uptftopl=$BinDir/uptftopl$ExeExt |
| 10 |
|
| 11 |
test -d uptests || mkdir -p uptests |
| 12 |
|
| 13 |
TEXMFCNF=$srcdir/../kpathsea |
| 14 |
export TEXMFCNF |
| 15 |
|
| 16 |
DIFF="diff" |
| 17 |
# pre-generated test results in the repository are stored in LF |
| 18 |
# but the output might be written in CRLF on some platform. |
| 19 |
# if 'diff --strip-trailing-cr' is available, exploit it. |
| 20 |
# (useful for tests on win32 binaries run on MSYS shell) |
| 21 |
$DIFF --strip-trailing-cr $0 $0 \ |
| 22 |
&& DIFF="diff --strip-trailing-cr" || echo |
| 23 |
|
| 24 |
# Test inputs |
| 25 |
testdir=$srcdir/uptexdir/tests |
| 26 |
|
| 27 |
# Testing upPLtoTF/upTFtoPL for huge GLUEKERN table |
| 28 |
# with rearrangement. |
| 29 |
for font in gkhugeok; do |
| 30 |
|
| 31 |
# This test is constructed as a cycle, since JPL source |
| 32 |
# of gkhugeok.tfm is so large. |
| 33 |
$_uptftopl -verbose $testdir/$font.tfm uptests/y$font.pl && \ |
| 34 |
$_uppltotf -verbose uptests/y$font.pl uptests/y$font.tfm && \ |
| 35 |
cmp $testdir/$font.tfm uptests/y$font.tfm && echo || exit 1 |
| 36 |
|
| 37 |
done |
| 38 |
|
| 39 |
for font in gkhugeng; do |
| 40 |
|
| 41 |
# Fifth byte of the JFM (= lf; length of the whole file) |
| 42 |
# must not exceed 2^{15}-1; check that and exit with an |
| 43 |
# error message, instead of trying to allocate too much. |
| 44 |
# The invalid gkhugeng.tfm was erroneously created before |
| 45 |
# web2c/pltotf.ch change 2017-09-10, due to overflow |
| 46 |
$_uptftopl $testdir/$font.tfm uptests/y$font.pl \ |
| 47 |
2>uptests/y$font.err && exit 1 || echo |
| 48 |
$DIFF $testdir/$font.err uptests/y$font.err && echo || exit 2 |
| 49 |
|
| 50 |
done |
| 51 |
|