summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorMartin Ruckert <martin.ruckert@hm.edu>2021-11-12 15:42:51 +0000
committerMartin Ruckert <martin.ruckert@hm.edu>2021-11-12 15:42:51 +0000
commit642c58f9ac19193f8c0032b67768bcab72628cee (patch)
treeab6c0d4bd7ab3657b6bfd3355ed682ab2bc08a76 /Build
parent58c3fe089d4cdc595f6f175a8a9bf35b9c53a89e (diff)
renaming format.w to hiformat.w adding the first test
git-svn-id: svn://tug.org/texlive/trunk@61034 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/hitexdir/am/hitex.am44
-rw-r--r--Build/source/texk/web2c/hitexdir/hiformat.w (renamed from Build/source/texk/web2c/hitexdir/format.w)0
-rw-r--r--Build/source/texk/web2c/hitexdir/tests/rule.test33
-rw-r--r--Build/source/texk/web2c/hitexdir/tests/rule.tex11
4 files changed, 74 insertions, 14 deletions
diff --git a/Build/source/texk/web2c/hitexdir/am/hitex.am b/Build/source/texk/web2c/hitexdir/am/hitex.am
index 2419d82d3bc..3abd066e31b 100644
--- a/Build/source/texk/web2c/hitexdir/am/hitex.am
+++ b/Build/source/texk/web2c/hitexdir/am/hitex.am
@@ -18,11 +18,12 @@ hiall: hitex hishrink histretch
hitex_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_INCLUDES)
hitex_CPPFLAGS += -I$(srcdir)/libmd5
+hitex_CPPFLAGS += -DINIT -DSTAT -DDEBUG
hitex_LDADD = $(KPATHSEA_LIBS) $(ZLIB_LIBS) libmd5.a
hitex_LDADD += libmd5.a
hitex_DEPENDENCIES = $(KPATHSEA_DEPEND) $(ZLIB_DEPEND) libmd5.a
#
-histretch_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_INCLUDES)
+histretch_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) -I$(srcdir)/hitexdir
histretch_LDADD = $(ZLIB_LIBS)
histretch_DEPENDENCIES = $(ZLIB_DEPEND)
#
@@ -32,28 +33,28 @@ hishrink_LDADD = $(ZLIB_LIBS)
hishrink_DEPENDENCIES = $(ZLIB_DEPEND)
# HiTeX CWEB sources
-hitex_web = hitexdir/format.w hitexdir/hitex.w
+hitex_web = hitexdir/hiformat.w hitexdir/hitex.w
# Creating several files: need stamp file and two rules with identical recipes
hi_ctangle_sh = CWEBINPUTS=$(srcdir)/hitexdir AM_V_P=$(AM_V_P) $(SHELL) ./tangle-sh $@ $(CTANGLE)
# HiTeX C/yacc/lex sources generated using ctangle.
# For each cweb (.w) source file, list the files generated.
-format_c_h_l_y = hibasetypes.h hierror.h hiformat.h \
+hiformat_c_h_l_y = hibasetypes.h hierror.h hiformat.h \
himktables.c \
hiput.c hiput.h \
higet.c higet.h \
hilexer.l hiparser.y \
hishrink.c histretch.c
-hitex_c_h = hitex.c hitex.h
+hitex_c = hitex.c
-$(format_c_h_l_y): format-tangle
- $(hi_ctangle_sh) format
+$(hiformat_c_h_l_y): hiformat-tangle
+ $(hi_ctangle_sh) hiformat
#
-format-tangle: ctangle$(EXEEXT) hitexdir/format.w tangle-sh
- $(hi_ctangle_sh) format
+hiformat-tangle: ctangle$(EXEEXT) hitexdir/hiformat.w tangle-sh
+ $(hi_ctangle_sh) hiformat
-$(hitex_c_h): hitex-tangle
+$(hitex_c): hitex-tangle
$(hi_ctangle_sh) hitex
#
hitex-tangle: ctangle$(EXEEXT) hitexdir/hitex.w tangle-sh
@@ -64,12 +65,12 @@ hitables.c: himktables
./himktables > $@ || { rm -f hitables.c; exit 1; }
# hitex
-nodist_hitex_SOURCES = hitables.c hiput.c $(hitex_c_h)
+nodist_hitex_SOURCES = hitables.c hiput.c $(hitex_c)
# histretch
nodist_histretch_SOURCES = hitables.c histretch.c
-# The actual sources for the lexer and parser are in format.w.
+# The actual sources for the lexer and parser are in hiformat.w.
# However, to simplify life with Automake (a little), we include the
# generated [.ch] files as if they were the sources here, and don't try
# to have Automake support the derivation from .w.
@@ -78,7 +79,8 @@ nodist_histretch_SOURCES = hitables.c histretch.c
# but can help with the remake if the [.ch] or [.ly] are not present.
nodist_hishrink_SOURCES = hitables.c \
hitexdir/hilexer.c \
- hitexdir/hiparser.c hitexdir/hiparser.h
+ hitexdir/hiparser.c hitexdir/hiparser.h \
+ hishrink.c
# This is our attempt to ensure that bison got run before anything else,
# when needed.
@@ -94,7 +96,21 @@ EXTRA_DIST += hitexdir/ChangeLog $(hitex_web)
DISTCLEANFILES += $(nodist_hitex_SOURCES)
DISTCLEANFILES += $(nodist_hishrink_SOURCES) $(nodist_histretch_SOURCES)
-DISTCLEANFILES += format-tangle hitex-tangle
+DISTCLEANFILES += hiformat-tangle hitex-tangle
## HiTeX tests
-# still missing
+#
+hitex_tests = hitexdir/tests/rule.test
+
+hitexdir/tests/rule.log: hitex$(EXEEXT) histretch$(EXEEXT) hishrink$(EXEEXT)
+
+
+EXTRA_DIST += $(hitex_tests)
+
+if HITEX
+TESTS += $(hitex_tests)
+endif HITEX
+
+## rule.test
+EXTRA_DIST += tests/rule.tex
+DISTCLEANFILES += rule.log
diff --git a/Build/source/texk/web2c/hitexdir/format.w b/Build/source/texk/web2c/hitexdir/hiformat.w
index 5b1fd22a2d8..5b1fd22a2d8 100644
--- a/Build/source/texk/web2c/hitexdir/format.w
+++ b/Build/source/texk/web2c/hitexdir/hiformat.w
diff --git a/Build/source/texk/web2c/hitexdir/tests/rule.test b/Build/source/texk/web2c/hitexdir/tests/rule.test
new file mode 100644
index 00000000000..24d55f53469
--- /dev/null
+++ b/Build/source/texk/web2c/hitexdir/tests/rule.test
@@ -0,0 +1,33 @@
+#! /bin/sh -vx
+# $Id: rule.test $
+# Public domain. Originally written by Martin Ruckert
+# Basic check that rule.tex can be hitexed stretched and shrinked.
+
+LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+TEXINPUTS=$srcdir/hitexdir/tests; export TEXINPUTS
+
+./hitex -ini --interaction=nonstopmode rule.tex || exit $?
+./histretch rule.hnt || exit $?
+./hishrink -o rule.out.hnt rule.HINT || exit $?
+./histretch rule.out.hnt || exit $?
+
+if grep -q "<rule 0x48.451Ept 1pt 0x1C.73E7pt>" rule.HINT
+then
+ : # OK
+else
+ echo "rule.HINT does not contain the propper rule"
+ exit 1
+fi
+
+if diff -q -w rule.out.HINT rule.HINT
+then
+ : #OK
+else
+ echo "rule.out.HINT and rule.HINT differ"
+ exit 1
+fi
+
+exit 0
+
diff --git a/Build/source/texk/web2c/hitexdir/tests/rule.tex b/Build/source/texk/web2c/hitexdir/tests/rule.tex
new file mode 100644
index 00000000000..b35b0a9abca
--- /dev/null
+++ b/Build/source/texk/web2c/hitexdir/tests/rule.tex
@@ -0,0 +1,11 @@
+% $Id: rule.tex $
+% Public domain. Test file for generating a single rule
+% Originally written 2021 Martin Ruckert
+
+\catcode`\{=1 \catcode`\}=2 % can run under -ini
+
+\hrule height 1in width 1cm depth 1pt
+\vfill
+
+\end
+