summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/omegafonts
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-01-12 07:38:12 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-01-12 07:38:12 +0000
commitd491195130658a9a332bf79d49dcc40a5af6244f (patch)
tree54ae3f1d1744402cf9d8e46859637f1a0d1685ff /Build/source/texk/web2c/omegafonts
parent5cb06055479d9bec7529d480c5f65132ea180264 (diff)
texk/web2c: OFM2OPL & Co (Web and C): Non-zero return code in case of problems
git-svn-id: svn://tug.org/texlive/trunk@36035 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/omegafonts')
-rw-r--r--Build/source/texk/web2c/omegafonts/ChangeLog10
-rw-r--r--Build/source/texk/web2c/omegafonts/Makefile.am11
-rw-r--r--Build/source/texk/web2c/omegafonts/Makefile.in56
-rwxr-xr-xBuild/source/texk/web2c/omegafonts/bad.test26
-rwxr-xr-xBuild/source/texk/web2c/omegafonts/check.test8
-rw-r--r--Build/source/texk/web2c/omegafonts/error_routines.c3
-rw-r--r--Build/source/texk/web2c/omegafonts/error_routines.h2
-rw-r--r--Build/source/texk/web2c/omegafonts/omfonts.c2
-rwxr-xr-xBuild/source/texk/web2c/omegafonts/selectfont.test4
-rw-r--r--Build/source/texk/web2c/omegafonts/tests/badofm.ofmbin0 -> 144 bytes
-rw-r--r--Build/source/texk/web2c/omegafonts/tests/badopl.opl1
-rw-r--r--Build/source/texk/web2c/omegafonts/tests/badovf.ofmbin0 -> 144 bytes
-rw-r--r--Build/source/texk/web2c/omegafonts/tests/badovf.ovfbin0 -> 24 bytes
-rw-r--r--Build/source/texk/web2c/omegafonts/tests/badovp.ovp1
-rwxr-xr-xBuild/source/texk/web2c/omegafonts/version.test20
15 files changed, 107 insertions, 37 deletions
diff --git a/Build/source/texk/web2c/omegafonts/ChangeLog b/Build/source/texk/web2c/omegafonts/ChangeLog
index 247d9d3d23e..b9adfacefff 100644
--- a/Build/source/texk/web2c/omegafonts/ChangeLog
+++ b/Build/source/texk/web2c/omegafonts/ChangeLog
@@ -1,3 +1,13 @@
+2015-01-11 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * error_routines.[ch], omfonts.c: Non-zero error return code.
+ * check.test: Also test writung OPL file to stdout.
+ * selectfont.test: Also test writung OVP file to stdout.
+ * bad.test, version.test: Shell scripts for new tests.
+ * tests/badofm.ofm, tests/badopl.opl, tests/badovf.{ofm,ovf},
+ tests/badovp.ovp: New test input files.
+ * Makefile.am: Add new test shell scripts and input files.
+
2014-11-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* omfonts.c: Help texts for C and Web2C versions differ.
diff --git a/Build/source/texk/web2c/omegafonts/Makefile.am b/Build/source/texk/web2c/omegafonts/Makefile.am
index 4ac33f4eced..59b5c88753b 100644
--- a/Build/source/texk/web2c/omegafonts/Makefile.am
+++ b/Build/source/texk/web2c/omegafonts/Makefile.am
@@ -1,6 +1,6 @@
## Makefile.am for the TeX Live subdirectory texk/web2c/omegafonts/
##
-## Copyright (C) 2009-2014 Peter Breitenlohner <tex-live@tug.org>
+## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir) $(KPATHSEA_INCLUDES) -DNOT_WEB2C
@@ -96,15 +96,20 @@ endif OTANGLE
## Tests
##
-OMFONTS_tests = charwd.test check.test help.test level1.test ligkern.test \
+OMFONTS_tests = bad.test charwd.test check.test help.test level1.test ligkern.test \
ofonts.test omfonts.test overbmp.test realnum.test repeat.test \
- selectfont.test shorten.test specialhex.test yannis.test
+ selectfont.test shorten.test specialhex.test version.test yannis.test
if OTANGLE
TESTS = $(OMFONTS_tests)
endif OTANGLE
EXTRA_DIST = $(OMFONTS_tests)
+## bad.test
+EXTRA_DIST += \
+ tests/badofm.ofm tests/badopl.opl \
+ tests/badovf.ofm tests/badovf.ovf tests/badovp.ovp
+DISTCLEANFILES += bad*.*
## charwd.test
EXTRA_DIST += tests/charwd-r.pl tests/charwd-v.vpl
DISTCLEANFILES += tests/charwdr.* tests/charwdv.*
diff --git a/Build/source/texk/web2c/omegafonts/Makefile.in b/Build/source/texk/web2c/omegafonts/Makefile.in
index f3fb4ebf2aa..ee9fb264626 100644
--- a/Build/source/texk/web2c/omegafonts/Makefile.in
+++ b/Build/source/texk/web2c/omegafonts/Makefile.in
@@ -716,15 +716,15 @@ omfonts_DEPENDENCIES = $(proglib) $(KPATHSEA_DEPEND)
call_omfonts_CPPFLAGS = -DEXEPROG=\"omfonts.exe\"
nodist_call_omfonts_SOURCES = ../callexe.c
call_omfonts_LDADD =
-DISTCLEANFILES = pl-parser.output tests/charwdr.* tests/charwdv.* \
- tests/xcheck* tests/xlevel1.* tests/xlig*.* tests/xofont* \
- tests/Cherokee.tfm tests/OCherokee.ofm tests/OCherokee.opl \
- tests/OCherokee.ovf tests/xCherokee.* tests/xOCherokee.* \
- tests/xinbmp* tests/xoverbmp* tests/realnum.* \
- tests/xrepeated.* tests/sample*.ofm tests/sample*.ovf \
- tests/sample1-h.opl tests/xsample*.out tests/shortend.* \
- tests/specialhex.ofm tests/specialhex.opl tests/specialhex.ovf \
- tests/xspecialhex.* tests/*yarabic*
+DISTCLEANFILES = pl-parser.output bad*.* tests/charwdr.* \
+ tests/charwdv.* tests/xcheck* tests/xlevel1.* tests/xlig*.* \
+ tests/xofont* tests/Cherokee.tfm tests/OCherokee.ofm \
+ tests/OCherokee.opl tests/OCherokee.ovf tests/xCherokee.* \
+ tests/xOCherokee.* tests/xinbmp* tests/xoverbmp* \
+ tests/realnum.* tests/xrepeated.* tests/sample*.ofm \
+ tests/sample*.ovf tests/sample1-h.opl tests/xsample*.out \
+ tests/shortend.* tests/specialhex.ofm tests/specialhex.opl \
+ tests/specialhex.ovf tests/xspecialhex.* tests/*yarabic*
linked_programs = ofm2opl opl2ofm ovf2ovp ovp2ovf
bin_links = \
omfonts$(EXEEXT):ofm2opl \
@@ -732,27 +732,29 @@ bin_links = \
omfonts$(EXEEXT):ovf2ovp \
omfonts$(EXEEXT):ovp2ovf
-OMFONTS_tests = charwd.test check.test help.test level1.test ligkern.test \
+OMFONTS_tests = bad.test charwd.test check.test help.test level1.test ligkern.test \
ofonts.test omfonts.test overbmp.test realnum.test repeat.test \
- selectfont.test shorten.test specialhex.test yannis.test
+ selectfont.test shorten.test specialhex.test version.test yannis.test
@OTANGLE_TRUE@TESTS = $(OMFONTS_tests)
-EXTRA_DIST = $(OMFONTS_tests) tests/charwd-r.pl tests/charwd-v.vpl \
- tests/check.ofm tests/check.opl tests/checked.opl \
- tests/level1.opl tests/ligall.opl tests/ligbch.opl \
- tests/ligbdy.opl tests/ligblb.opl tests/ligblv.opl \
- tests/ligblv.ovp tests/ligloop1.ofm tests/ligloop1.opl \
- tests/ligloop2.opl tests/liguse.opl tests/liguse1.opl \
- tests/liguse2.opl tests/ofontr0.pl tests/ofontr1.pl \
- tests/ofontr1.vpl tests/ofontr2.opl tests/ofontr2.ovp \
- tests/ofontr3.opl tests/ofontr3.ovp tests/ofontv4.pl \
- tests/ofontv4.vpl tests/ofontv5.opl tests/ofontv5.ovp \
- tests/ofontv6.opl tests/ofontv6.ovp tests/Cherokee.pl \
- tests/OCherokee.ovp tests/inbmp.opl tests/overbmp.opl \
- tests/overbmp.ovp tests/realnum.opl tests/realnum.out \
- tests/repeat.opl tests/repeated.opl tests/sample.out \
- tests/sample.ovp tests/sample0-h.opl tests/shorten.opl \
- tests/specialhex.ovp tests/arabicr.pl tests/arabic.ovp
+EXTRA_DIST = $(OMFONTS_tests) tests/badofm.ofm tests/badopl.opl \
+ tests/badovf.ofm tests/badovf.ovf tests/badovp.ovp \
+ tests/charwd-r.pl tests/charwd-v.vpl tests/check.ofm \
+ tests/check.opl tests/checked.opl tests/level1.opl \
+ tests/ligall.opl tests/ligbch.opl tests/ligbdy.opl \
+ tests/ligblb.opl tests/ligblv.opl tests/ligblv.ovp \
+ tests/ligloop1.ofm tests/ligloop1.opl tests/ligloop2.opl \
+ tests/liguse.opl tests/liguse1.opl tests/liguse2.opl \
+ tests/ofontr0.pl tests/ofontr1.pl tests/ofontr1.vpl \
+ tests/ofontr2.opl tests/ofontr2.ovp tests/ofontr3.opl \
+ tests/ofontr3.ovp tests/ofontv4.pl tests/ofontv4.vpl \
+ tests/ofontv5.opl tests/ofontv5.ovp tests/ofontv6.opl \
+ tests/ofontv6.ovp tests/Cherokee.pl tests/OCherokee.ovp \
+ tests/inbmp.opl tests/overbmp.opl tests/overbmp.ovp \
+ tests/realnum.opl tests/realnum.out tests/repeat.opl \
+ tests/repeated.opl tests/sample.out tests/sample.ovp \
+ tests/sample0-h.opl tests/shorten.opl tests/specialhex.ovp \
+ tests/arabicr.pl tests/arabic.ovp
all: all-am
.SUFFIXES:
diff --git a/Build/source/texk/web2c/omegafonts/bad.test b/Build/source/texk/web2c/omegafonts/bad.test
new file mode 100755
index 00000000000..92baa688567
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/bad.test
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+# Copyright (C) 2015 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+TEXMFCNF=$srcdir/../../kpathsea
+OFMFONTS=$srcdir/tests
+export TEXMFCNF OFMFONTS
+
+echo && echo "*** ./omfonts"
+./omfonts && exit 1
+
+echo && echo "*** ofm2opl badofm badofm"
+./omfonts -ofm2opl $srcdir/tests/badofm badofm && exit 1
+
+echo && echo "*** opl2ofm badopl badopl"
+./omfonts -opl2ofm $srcdir/tests/badopl badopl && exit 1
+
+echo && echo "*** ovf2ovp badovf badovf badovf"
+./omfonts -ovf2ovp $srcdir/tests/badovf $srcdir/tests/badovf badovf && exit 1
+
+echo && echo "*** ovp2ovf badovp badovp"
+./omfonts -ovp2ovf $srcdir/tests/badovp badovp && exit 1
+
+exit 0
+
diff --git a/Build/source/texk/web2c/omegafonts/check.test b/Build/source/texk/web2c/omegafonts/check.test
index 288cb9411ef..6ca13f7d1c9 100755
--- a/Build/source/texk/web2c/omegafonts/check.test
+++ b/Build/source/texk/web2c/omegafonts/check.test
@@ -1,10 +1,8 @@
#! /bin/sh
-# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2014, 2015 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
-tests=tests
-
test -d tests || mkdir -p tests
TEXMFCNF=$srcdir/../../kpathsea
@@ -20,8 +18,8 @@ diff $srcdir/tests/check.opl tests/xcheck.opl || exit 1
echo && echo "*** opl2ofm xcheck xchecked"
./omfonts -opl2ofm tests/xcheck tests/xchecked || exit 1
-echo && echo "*** ofm2opl xchecked xchecked"
-./omfonts -ofm2opl tests/xchecked tests/xchecked || exit 1
+echo && echo "*** ofm2opl xchecked stdout (xchecked.opl)"
+./omfonts -ofm2opl tests/xchecked >tests/xchecked.opl || exit 1
echo && echo "*** diff checked.opl xchecked.opl"
diff $srcdir/tests/checked.opl tests/xchecked.opl || exit 1
diff --git a/Build/source/texk/web2c/omegafonts/error_routines.c b/Build/source/texk/web2c/omegafonts/error_routines.c
index f3d23bfe1a3..ec7979860bf 100644
--- a/Build/source/texk/web2c/omegafonts/error_routines.c
+++ b/Build/source/texk/web2c/omegafonts/error_routines.c
@@ -25,6 +25,8 @@ along with Omega; if not, write to the Free Software Foundation, Inc.,
#include "parser.h"
#include "error_routines.h"
+int num_errors = 0;
+
/* Error routines:
All of the routines in this file have the same general format.
@@ -62,6 +64,7 @@ yyerror(const_string fmt)
fprintf(stderr, "line %d (parsing): ", line_number);
fprintf(stderr, fmt);
fprintf(stderr, "\n");
+ num_errors++;
}
diff --git a/Build/source/texk/web2c/omegafonts/error_routines.h b/Build/source/texk/web2c/omegafonts/error_routines.h
index 6a707c77aa6..c27d1cd9f01 100644
--- a/Build/source/texk/web2c/omegafonts/error_routines.h
+++ b/Build/source/texk/web2c/omegafonts/error_routines.h
@@ -21,6 +21,8 @@ along with Omega; if not, write to the Free Software Foundation, Inc.,
*/
+extern int num_errors;
+
extern void lex_error_1(const_string, int);
extern void lex_error_s(const_string, const_string);
extern void lex_error_s_1(const_string, const_string, int);
diff --git a/Build/source/texk/web2c/omegafonts/omfonts.c b/Build/source/texk/web2c/omegafonts/omfonts.c
index 0b9f9c3e5c4..2df884388b9 100644
--- a/Build/source/texk/web2c/omegafonts/omfonts.c
+++ b/Build/source/texk/web2c/omegafonts/omfonts.c
@@ -293,6 +293,7 @@ main (int argc, string *argv)
(void)yyparse();
output_ofm_file();
(void)fclose(file_ofm);
+ if (num_errors > 0) exit(1);
break;
}
case PROG_OVP2OVF: {
@@ -306,6 +307,7 @@ main (int argc, string *argv)
(void)fclose(file_ofm);
output_ovf_file();
(void)fclose(file_ovf);
+ if (num_errors > 0) exit(1);
break;
}
default: {exit(1);}
diff --git a/Build/source/texk/web2c/omegafonts/selectfont.test b/Build/source/texk/web2c/omegafonts/selectfont.test
index d6024571107..ea038ff404a 100755
--- a/Build/source/texk/web2c/omegafonts/selectfont.test
+++ b/Build/source/texk/web2c/omegafonts/selectfont.test
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2011-2013 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2011-2015 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
test -d tests || mkdir -p tests
@@ -25,7 +25,7 @@ diff $srcdir/tests/sample.out tests/xsample.out || exit 1
./omfonts -ovp2ovf -verbose $srcdir/tests/sample.ovp tests/sample2.ovf || exit 1
-./omfonts -ovf2ovp -verbose tests/sample2 sample2 tests/xsample2.out || exit 1
+./omfonts -ovf2ovp -verbose tests/sample2 sample2 >tests/xsample2.out || exit 1
diff $srcdir/tests/sample.out tests/xsample2.out || exit 1
diff --git a/Build/source/texk/web2c/omegafonts/tests/badofm.ofm b/Build/source/texk/web2c/omegafonts/tests/badofm.ofm
new file mode 100644
index 00000000000..69bbde45383
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/tests/badofm.ofm
Binary files differ
diff --git a/Build/source/texk/web2c/omegafonts/tests/badopl.opl b/Build/source/texk/web2c/omegafonts/tests/badopl.opl
new file mode 100644
index 00000000000..d8a0885e0a5
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/tests/badopl.opl
@@ -0,0 +1 @@
+(Not an OPL file.
diff --git a/Build/source/texk/web2c/omegafonts/tests/badovf.ofm b/Build/source/texk/web2c/omegafonts/tests/badovf.ofm
new file mode 100644
index 00000000000..988dbbe6e47
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/tests/badovf.ofm
Binary files differ
diff --git a/Build/source/texk/web2c/omegafonts/tests/badovf.ovf b/Build/source/texk/web2c/omegafonts/tests/badovf.ovf
new file mode 100644
index 00000000000..cdea3200598
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/tests/badovf.ovf
Binary files differ
diff --git a/Build/source/texk/web2c/omegafonts/tests/badovp.ovp b/Build/source/texk/web2c/omegafonts/tests/badovp.ovp
new file mode 100644
index 00000000000..11c1823086d
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/tests/badovp.ovp
@@ -0,0 +1 @@
+(Not an OVP file.
diff --git a/Build/source/texk/web2c/omegafonts/version.test b/Build/source/texk/web2c/omegafonts/version.test
new file mode 100755
index 00000000000..18121ee536a
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/version.test
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Copyright (C) 2015 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+echo && echo "*** omfonts -version"
+./omfonts -version || exit 1
+
+echo && echo "*** ofm2opl -version"
+./omfonts -ofm2opl -version || exit 1
+
+echo && echo "*** opl2ofm -version"
+./omfonts -opl2ofm -version || exit 1
+
+echo && echo "*** ovf2ovp -version"
+./omfonts -ovf2ovp -version || exit 1
+
+echo && echo "*** ovp2ovf -version"
+./omfonts -ovp2ovf -version || exit 1
+