diff options
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-check.lua')
-rw-r--r-- | Master/texmf-dist/scripts/l3build/l3build-check.lua | 63 |
1 files changed, 24 insertions, 39 deletions
diff --git a/Master/texmf-dist/scripts/l3build/l3build-check.lua b/Master/texmf-dist/scripts/l3build/l3build-check.lua index 837b6356cbf..711d367331c 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-check.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-check.lua @@ -541,9 +541,9 @@ function runcheck(name, hide) checkengines = options["engine"] end -- Used for both .lvt and .pvt tests - local function check_and_diff(ext,engine,enginename,comp,pdftest) + local function check_and_diff(ext,engine,comp,pdftest) runtest(name,engine,hide,ext,pdftest,true) - local errorlevel = comp(name,enginename) + local errorlevel = comp(name,engine) if errorlevel ~= 0 and options["halt-on-error"] then showfaileddiff() return 1 @@ -552,17 +552,12 @@ function runcheck(name, hide) end local errorlevel = 0 for _,engine in pairs(checkengines) do - local enginename = engine - -- Allow for luatex == luajittex for .tlg/.tpf purposes - if match(engine,"^lua") then - engine = "luatex" - end setup_check(name,engine) local errlevel = 0 if fileexists(testfiledir .. "/" .. name .. pvtext) then - errlevel = check_and_diff(pvtext,engine,enginename,compare_pdf,true) + errlevel = check_and_diff(pvtext,engine,compare_pdf,true) else - errlevel = check_and_diff(lvtext,engine,enginename,compare_tlg) + errlevel = check_and_diff(lvtext,engine,compare_tlg) end if errlevel ~= 0 and options["halt-on-error"] then return 1 @@ -626,7 +621,7 @@ function compare_pdf(name,engine,cleanup) return errorlevel end -function compare_tlg(name, engine,cleanup) +function compare_tlg(name,engine,cleanup) local errorlevel local testname = name .. "." .. engine local difffile = testdir .. "/" .. testname .. os_diffext @@ -637,7 +632,7 @@ function compare_tlg(name, engine,cleanup) end -- Do additional log formatting if the engine is LuaTeX, there is no -- LuaTeX-specific .tlg file and the default engine is not LuaTeX - if engine == "luatex" + if match(engine,"^lua") and not match(tlgfile, "%.luatex" .. "%" .. tlgext) and not match(stdengine,"^lua") then @@ -670,24 +665,25 @@ function runtest(name, engine, hide, ext, pdfmode, breakout) local lvtfile = name .. (ext or lvtext) cp(lvtfile, fileexists(testfiledir .. "/" .. lvtfile) and testfiledir or unpackdir, testdir) + local checkopts = checkopts local engine = engine or stdengine - local realengine = engine - local format = "" - if checkformat == "latex" then - -- Special case for e-LaTeX format - if engine == "etex" then - format = " -fmt=latex" - -- Use "...latex" formats for other engines - elseif not match(engine,"latex") then - format = " -fmt=" .. gsub(engine,"tex","latex") - end - -- Special case for (u)pTeX LaTeX - if match(engine,"^u?ptex$") then - realengine = "e" .. engine - end + local binary = engine + local format = gsub(engine,"tex$",checkformat) + -- Special binary/format combos + if specialformats[checkformat] and next(specialformats[checkformat]) then + local t = specialformats[checkformat] + if t[engine] and next(t[engine]) then + local t = t[engine] + binary = t.binary or binary + checkopts = t.options or checkopts + format = t.format or format + end + end + -- Finalise format string + if format ~= "" then + format = " --fmt=" .. format end -- Special casing for XeTeX engine - local checkopts = checkopts if match(engine, "xetex") and not pdfmode then checkopts = checkopts .. " -no-pdf" end @@ -695,19 +691,8 @@ function runtest(name, engine, hide, ext, pdfmode, breakout) local function setup(file) return " -jobname=" .. name .. " " .. ' "\\input ' .. file .. '" ' end - if match(checkformat, "^context$") then - format = "" + if match(checkformat,"^context$") then function setup(file) return ' "' .. file .. '" ' end - if match(engine,"^lua") then - realengine = "context" - elseif engine == "pdftex" then - realengine = "texexec" - elseif engine == "xetex" then - realengine = "texexec --xetex" - else - print("Engine incompatible with format") - exit(1) - end end local basename = testdir .. "/" .. name local logfile = basename .. logext @@ -743,7 +728,7 @@ function runtest(name, engine, hide, ext, pdfmode, breakout) -- Ensure lines are of a known length os_setenv .. " max_print_line=" .. maxprintline .. os_concat .. - realengine .. format + binary .. format .. " " .. asciiopt .. " " .. checkopts .. setup(lvtfile) .. (hide and (" > " .. os_null) or "") |