[latex3-commits] [git/LaTeX3-latex3-l3build] main: Support token injection using specialformats (10783e2)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Dec 9 10:40:08 CET 2021
Repository : https://github.com/latex3/l3build
On branch : main
Link : https://github.com/latex3/l3build/commit/10783e2ad0f05972c331da229aba48e6c5a3324d
>---------------------------------------------------------------
commit 10783e2ad0f05972c331da229aba48e6c5a3324d
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Dec 9 09:37:21 2021 +0000
Support token injection using specialformats
>---------------------------------------------------------------
10783e2ad0f05972c331da229aba48e6c5a3324d
CHANGELOG.md | 1 +
l3build-check.lua | 7 +++++--
l3build.dtx | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0b4ff95..075e326 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
### Added
- Support for pre-constructed TDS-style sources (variable `tdsdirs`)
+- Support for injection of tokens using `specialformats`
## [2021-12-06]
diff --git a/l3build-check.lua b/l3build-check.lua
index 03ce635..65ac222 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -719,6 +719,7 @@ function runtest(name, engine, hide, ext, test_type, breakout)
cp(lvtfile, fileexists(testfiledir .. "/" .. lvtfile)
and testfiledir or unpackdir, testdir)
local checkopts = checkopts
+ local tokens = ""
engine = engine or stdengine
local binary = engine
local format = gsub(engine,"tex$",checkformat)
@@ -730,6 +731,8 @@ function runtest(name, engine, hide, ext, test_type, breakout)
binary = engine_info.binary or binary
format = engine_info.format or format
checkopts = engine_info.options or checkopts
+ tokens = engine_info.tokens and (' "' .. engine_info.tokens .. '" ')
+ or tokens
end
end
-- Finalise format string
@@ -742,10 +745,10 @@ function runtest(name, engine, hide, ext, test_type, breakout)
end
-- Special casing for ConTeXt
local function setup(file)
- return " -jobname=" .. name .. " " .. ' "\\input ' .. file .. '" '
+ return " -jobname=" .. name .. tokens .. ' "\\input ' .. file .. '" '
end
if match(checkformat,"^context$") then
- function setup(file) return ' "' .. file .. '" ' end
+ function setup(file) return tokens .. ' "' .. file .. '" ' end
end
local basename = testdir .. "/" .. name
local gen_file = basename .. test_type.generated
diff --git a/l3build.dtx b/l3build.dtx
index 27269f2..90059fa 100644
--- a/l3build.dtx
+++ b/l3build.dtx
@@ -816,6 +816,9 @@
% xetex = {binary = "texexec", format = "", options = "--xetex"}
% }
% \end{verbatim}
+% Additional tokens can also be injected before the loading of a test file using
+% the |tokens| entry: this might for example be used to select a graphics driver
+% with a DVI-based route.
%
% \subsection{Output normalisation}
% \label{sec:norm}
More information about the latex3-commits
mailing list.