[tex-live] etex

jfbu jfbu at free.fr
Tue Jan 10 17:49:08 CET 2017


Le 10 janv. 2017 à 16:00, David Carlisle <d.p.carlisle at gmail.com> a écrit :

> Goes to the log but you can get the box output without raising an error eg
> 
> %%%%%%%%%%%%%%%%
> \tracingonline1
> 
> \setbox0=\vbox{\hsize=5cm
> one
> 
> two
> 
> {\bf three}
> 
> $x=y$
> }
> 
> \setbox0=\hbox to \maxdimen{\box0}
> 
> 
> \bye
> %%%%%%%%%%%%%%%%%%
> 
> so long as you ignore the spurious underfull hbox around the outside
> (this essentially is the same trick \showhyphens uses)

oh this is good trick.

If I insert \nonstopmode before the second \setbox0
and run with etex -interaction batchmode foo.tex
I get the information I want to stdout with only the
pdftex banner as extra and my shell script can redirect
that to a file, which will be the one git-controlled.
Also I can do all this without creation of a dvi file.

this is better than my current method with \tracingoutput1
which requires some use of tail and head to extract what I
want from the log file,
(and I had not polished it, so older releases of my package
using less \count's had the log lines shifted hence caused a diff
when running the test)

ok, I have got it working now (something like

    ... set up working directory, copy there or generate tex and "tlg" files
    ... set up git repo with the "tlg" files (I stole extension from l3build ;-)
    
    # do all the unit tests

    # now do the sole test handling boxes
    # the fancy stuff here I copied pasted, it is to avoid creating temp file
    mkfifo mypipe
    tail -n +2 > testcatcodes.tlg < mypipe &
    etex -halt-on-error -interaction batchmode -- testcatcodes.tex >mypipe 2>&1
    if [ $? -eq 0 ]
    then
        # no error with TeX run
        check for "occurred" in log file,
        then run git diff --quiet on ".tlg" file and check its $?
        ... inform the user ...
    else
      # error with TeX run
      ... print some big red thing and set status flag to 1 for final exit code ...
    fi
    rm mypipe # but I have to clean the fifo pipe anyhow

Thanks,

Jean-François
PS
I know about l3build -- whose documentation I have looked at --
but I don't use it for this package because I don't need all its power,
particularly for typesetting checks, as my package is not about
typesetting, and the thing above is to catch if style files create
spaces or \par on input (or upset catcodes)





More information about the tex-live mailing list