From f63af9a552cf853b4fa622750ffbf749cd333533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 13 Jan 2010 19:58:14 +0100 Subject: Add test files for regs. --- Makefile | 13 ++++++++++--- TODO | 14 ++++++++++++++ luatexbase-regs.dtx | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9716ade..e12100c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Makefile for luaotfload +# Makefile for luatexbase NAME = luatexbase DTX = $(wildcard *.dtx) @@ -6,7 +6,8 @@ DOC = $(patsubst %.dtx, %.pdf, $(DTX)) # Files grouped by generation mode UNPACKED_MCB = luamcallbacks-test.tex luamcallbacks.lua -UNPACKED_REGS = luatexbase-regs.sty luatexbase-regs-latex.tex +UNPACKED_REGS = luatexbase-regs.sty luatexbase-regs-latex.tex \ + test-regs-plain.tex test-regs-latex.tex UNPACKED = $(UNPACKED_MCB) $(UNPACKED_REGS) COMPILED = $(DOC) GENERATED = $(COMPILED) $(UNPACKED) @@ -36,11 +37,13 @@ DO_TEX = tex --interaction=batchmode $< >/dev/null DO_PDFLATEX = pdflatex --interaction=batchmode $< >/dev/null DO_MAKEINDEX = makeindex -s gind.ist $(subst .dtx,,$<) >/dev/null 2>&1 +# Main targets definition all: $(GENERATED) +check: check-regs doc: $(COMPILED) unpack: $(UNPACKED) ctan: $(CTAN_ZIP) -tds: $(TDS_ZIP) +tds: check $(TDS_ZIP) world: all ctan %.pdf: %.dtx @@ -55,6 +58,10 @@ $(UNPACKED_MCB): luamcallbacks.dtx $(UNPACKED_REGS): luatexbase-regs.dtx $(DO_TEX) +check-regs: $(UNPACKED_REGS) + #luatex --interaction=batchmode test-regs-latex.tex >/dev/null + lualatex --interaction=batchmode test-regs-latex.tex >/dev/null + $(CTAN_ZIP): $(SOURCE) $(COMPILED) $(TDS_ZIP) @echo "Making $@ for CTAN upload." @$(RM) -- $@ diff --git a/TODO b/TODO index ec18aaf..12b6f9a 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,18 @@ +general +------- + - change lua module names - check for name conflicts ('module' used in mods) - test +- reload check, declaration, luatex test +- import/update doc +- fix Makefile: test files are doc, not runfiles + +regs +---- + +- fix box & mark allocation (mathcherdef -> chardef) +- check why only 100 or so \inserts can be allocated +- make it work with Plain! + diff --git a/luatexbase-regs.dtx b/luatexbase-regs.dtx index c5bc600..74d56a5 100644 --- a/luatexbase-regs.dtx +++ b/luatexbase-regs.dtx @@ -59,6 +59,12 @@ and the derived files \file{luatexbase-regs-latex.tex}{\from{luatexbase-regs.dtx}{latexfile}}% } +\generate{% + \usedir{doc/luatex/luatexbase}% + \file{test-regs-plain.tex}{\from{luatexbase-regs.dtx}{testplain}}% + \file{test-regs-latex.tex}{\from{luatexbase-regs.dtx}{testlatex}}% +} + \obeyspaces \Msg{************************************************************************} \Msg{*} @@ -81,6 +87,10 @@ and the derived files \ProvidesFile{luatexbase-regs.drv} [DATE DESC] \documentclass{ltxdoc} +\makeatletter +\newcommand\eTeX{$\m@th\varepsilon$-\TeX} +\newcommand\LuaTeX{Lua\TeX} +\makeatother \EnableCrossrefs \CodelineIndex \begin{document} @@ -182,5 +192,49 @@ and the derived files % % \end{macrocode} % +% \section{Test files} +% +% Here we test only the two main formatis: Plain~\TeX\ (with etex.src +% loaded) and \LaTeX, both with the \LuaTeX\ engine. Those correspond to +% the \texttt{luatex} and \texttt{lualatex} commands in \TeX\,Live. +% +% We want to make sure we can globally and locally allocate $30000$ +% registers of each kind, and still globally allocate $100$ +% \verb+\insert+s. (Those numbers are not optimal, but they should be +% enough for testing purposes.) +% +% \begin{macrocode} +%\input luatexbase-regs.sty +%\RequirePackage{luatexbase-regs} +%<*testplain,testlatex> +\def\checkregister#1{% + \edef\newregister{\expandafter\noexpand\csname new#1\endcsname}% + \edef\locregister{\expandafter\noexpand\csname loc#1\endcsname}% + \count0 1 + \loop + \newregister\dummy + \locregister\dummy + \ifnum\count0<30000 + \advance\count0 1 + \repeat} +\checkregister{count} +\checkregister{dimen} +\checkregister{skip} +\checkregister{muskip} +%%\checkregister{box} +\checkregister{toks} +%%\checkregister{marks} + +\count0 1 +\loop \ifnum\count0<100 + \newinsert\dummy + \advance\count0 1 +\repeat +% +%\bye +%\stop +% \end{macrocode} +% +% % \Finale \endinput -- cgit v1.2.3