texlive[67914] Build/source/texk/ttf2pk2: ttf2pk: update a test

commits+takuji at tug.org commits+takuji at tug.org
Sun Aug 13 15:51:34 CEST 2023


Revision: 67914
          http://tug.org/svn/texlive?view=revision&revision=67914
Author:   takuji
Date:     2023-08-13 15:51:34 +0200 (Sun, 13 Aug 2023)
Log Message:
-----------
ttf2pk: update a test

Modified Paths:
--------------
    trunk/Build/source/texk/ttf2pk2/ChangeLog
    trunk/Build/source/texk/ttf2pk2/tests/ttf2pk.test

Modified: trunk/Build/source/texk/ttf2pk2/ChangeLog
===================================================================
--- trunk/Build/source/texk/ttf2pk2/ChangeLog	2023-08-13 13:51:27 UTC (rev 67913)
+++ trunk/Build/source/texk/ttf2pk2/ChangeLog	2023-08-13 13:51:34 UTC (rev 67914)
@@ -1,3 +1,7 @@
+2023-08-13  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* tests/ttf2pk.test: Make easier to test on Windows.
+
 2021-02-06  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* ttf2pk.c, ttf2tfm.c, configure.ac:

Modified: trunk/Build/source/texk/ttf2pk2/tests/ttf2pk.test
===================================================================
--- trunk/Build/source/texk/ttf2pk2/tests/ttf2pk.test	2023-08-13 13:51:27 UTC (rev 67913)
+++ trunk/Build/source/texk/ttf2pk2/tests/ttf2pk.test	2023-08-13 13:51:34 UTC (rev 67914)
@@ -4,74 +4,93 @@
 # Copyright 2011, 2012 Peter Breitenlohner <tex-live at tug.org>
 # You may freely use, modify and/or distribute this file.
 
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_tftopl=tftopl$ExeExt
+_pktype=pktype$ExeExt
+_ttf2tfm=$BinDir/ttf2tfm$ExeExt
+_ttf2pk=$BinDir/ttf2pk$ExeExt
+
+# pre-generated test results in the repository are stored in LF
+# but the output might be written in CRLF on some platform.
+# if 'diff --strip-trailing-cr' is available, exploit it.
+# (useful for tests on win32 binaries run on MSYS shell)
+DIFF="diff"
+$DIFF --strip-trailing-cr $0 $0 \
+  && DIFF="diff --strip-trailing-cr" || echo
+
+rc=0
+
 rm -f GenR-ec.vpl GenR102-* ipaexg-*
 
 TEXMFCNF=$srcdir/../kpathsea
-TEXFONTS=.:$srcdir/tests
+TEXFONTS=".;$srcdir/tests"
 TTF2PKINPUTS=$srcdir/tests
 SFDFONTS="$srcdir/data;$srcdir/tests"
+PATH=../web2c:$PATH
 
-export TEXMFCNF TEXFONTS TTF2PKINPUTS SFDFONTS
+export TEXMFCNF TEXFONTS TTF2PKINPUTS SFDFONTS PATH
 
-./ttf2tfm GenR102 -u -q -N -T gentium-ec -v GenR-ec GenR102-ec >GenR102-ec.map || exit 1
-diff $srcdir/tests/GenR102-ec.map GenR102-ec.map || exit 1
-diff $srcdir/tests/GenR-ec.vpl GenR-ec.vpl || exit 1
+$_ttf2tfm GenR102 -u -q -N -T gentium-ec -v GenR-ec GenR102-ec >GenR102-ec.map || rc=1
+$DIFF $srcdir/tests/GenR102-ec.map GenR102-ec.map || rc=2
+$DIFF $srcdir/tests/GenR-ec.vpl GenR-ec.vpl || rc=3
 
-./ttf2pk -q GenR102-ec 100 || exit 1
+$_ttf2pk -q GenR102-ec 100 || rc=4
 
-tftopl GenR102-ec GenR102-ec || exit 77
-diff $srcdir/tests/GenR102-ec.pl GenR102-ec.pl || exit 1
-pktype GenR102-ec.100pk >GenR102-ec.typ || exit 77
+$_tftopl GenR102-ec GenR102-ec || exit 77
+diff $srcdir/tests/GenR102-ec.pl GenR102-ec.pl || rc=5
+$_pktype GenR102-ec.100pk >GenR102-ec.typ || exit 77
 
 echo passed GenR102-ec test
 
-./ttf2tfm GenR102 -q GenR102-h at UBig5@ >GenR102-h.map || exit 1
-diff $srcdir/tests/GenR102-h.map GenR102-h.map || exit 1
+$_ttf2tfm GenR102 -q GenR102-h at UBig5@ >GenR102-h.map || rc=6
+$DIFF $srcdir/tests/GenR102-h.map GenR102-h.map || rc=7
 
 for sf in 00 01 02 24; do
 
-  ./ttf2pk -q GenR102-h$sf 100 || exit 1
+  $_ttf2pk -q GenR102-h$sf 100 || rc=8
 
-  tftopl GenR102-h$sf GenR102-h$sf || exit 77
-  pktype GenR102-h$sf.100pk >GenR102-h$sf.typ || exit 77
+  $_tftopl GenR102-h$sf GenR102-h$sf || exit 77
+  $_pktype GenR102-h$sf.100pk >GenR102-h$sf.typ || exit 77
 
 done
 
 echo passed GenR102-h test
 
-./ttf2tfm GenR102 -q -x GenR102-v at UBig5@ >GenR102-v.map || exit 1
-diff $srcdir/tests/GenR102-v.map GenR102-v.map || exit 1
+$_ttf2tfm GenR102 -q -x GenR102-v at UBig5@ >GenR102-v.map || rc=9
+$DIFF $srcdir/tests/GenR102-v.map GenR102-v.map || rc=10
 
 for sf in 00 01 02 24; do
 
-  ./ttf2pk -q GenR102-v$sf 100 || exit 1
+  $_ttf2pk -q GenR102-v$sf 100 || rc=11
 
-  tftopl GenR102-v$sf GenR102-v$sf || exit 77
-  pktype GenR102-v$sf.100pk >GenR102-v$sf.typ || exit 77
+  $_tftopl GenR102-v$sf GenR102-v$sf || exit 77
+  $_pktype GenR102-v$sf.100pk >GenR102-v$sf.typ || exit 77
 
 done
 
 echo passed GenR102-v test
 
-./ttf2tfm ipaexg -q ipaexg-h at Test@ >ipaexg-h.map || exit 1
-diff $srcdir/tests/ipaexg-h.map ipaexg-h.map || exit 1
+$_ttf2tfm ipaexg -q ipaexg-h at Test@ >ipaexg-h.map || rc=12
+$DIFF $srcdir/tests/ipaexg-h.map ipaexg-h.map || rc=13
 
-./ttf2pk -q ipaexg-h03 100 || exit 1
+$_ttf2pk -q ipaexg-h03 100 || rc=14
 
-tftopl ipaexg-h03 ipaexg-h03  || exit 77
-diff $srcdir/tests/ipaexg-h03.pl ipaexg-h03.pl || exit 1
-pktype ipaexg-h03.100pk >ipaexg-h03.typ || exit 77
+$_tftopl ipaexg-h03 ipaexg-h03  || exit 77
+diff $srcdir/tests/ipaexg-h03.pl ipaexg-h03.pl || rc=15
+$_pktype ipaexg-h03.100pk >ipaexg-h03.typ || exit 77
 
 echo passed ipaexg-h test
 
-./ttf2tfm ipaexg -q -x ipaexg-v at Test@ >ipaexg-v.map || exit 1
-diff $srcdir/tests/ipaexg-v.map ipaexg-v.map || exit 1
+$_ttf2tfm ipaexg -q -x ipaexg-v at Test@ >ipaexg-v.map || rc=16
+$DIFF $srcdir/tests/ipaexg-v.map ipaexg-v.map || rc=17
 
-./ttf2pk -q ipaexg-v03 100 || exit 1
+$_ttf2pk -q ipaexg-v03 100 || rc=18
 
-tftopl ipaexg-v03 ipaexg-v03  || exit 77
-diff $srcdir/tests/ipaexg-v03.pl ipaexg-v03.pl || exit 1
-pktype ipaexg-v03.100pk >ipaexg-v03.typ || exit 77
+$_tftopl ipaexg-v03 ipaexg-v03  || exit 77
+diff $srcdir/tests/ipaexg-v03.pl ipaexg-v03.pl || rc=19
+$_pktype ipaexg-v03.100pk >ipaexg-v03.typ || exit 77
 
 echo passed ipaexg-v test
 
+exit $rc



More information about the tex-live-commits mailing list.