latex3 / l3build

A testing and building system for LaTeX
LaTeX Project Public License v1.3c
84 stars 14 forks source link

Output normalization hook #349

Open muzimuzhi opened 4 months ago

muzimuzhi commented 4 months ago

To apply additional normalization, after built-in output normalization is done. Could be named normalize_hook().

Use case: to simplify specific test output, for example the log-based m3plain002.lvt test in latex3, added in https://github.com/latex3/latex3/pull/1467

https://github.com/latex3/latex3/pull/1467#issuecomment-1957438494:

Commit 6f301f1 adds a plainTeX test that loads expl3-generic.tex in a group with \tracingrestores turned on. I think it dumps too many lines hence am considering dropping it in final state.

Is there a way to track lines containing =undefined} only? If so, I'm willing to keep m3plain002.lvt.

cfr42 commented 4 days ago

This would be useful for testing font packages because it would let me remove glue/box lines. (I could post-process the output with something like sed or perl, much as @davidcarlisle suggested, but that means abandoning cross-platform/cross-distribution compatibility.) As far as I know there's no tracing option for pdfTeX/TeX which will give me (all) the font lines I want without the lines I don't. Right now the only cross-platform options appear to be to rewriting the normalisation function or tolerating the 'noise'.