summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3build/l3build-check.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3build/l3build-check.lua')
-rw-r--r--Master/texmf-dist/tex/latex/l3build/l3build-check.lua48
1 files changed, 36 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/l3build/l3build-check.lua b/Master/texmf-dist/tex/latex/l3build/l3build-check.lua
index 617fa56a0c6..40c28561253 100644
--- a/Master/texmf-dist/tex/latex/l3build/l3build-check.lua
+++ b/Master/texmf-dist/tex/latex/l3build/l3build-check.lua
@@ -37,6 +37,7 @@ local gmatch = string.gmatch
local gsub = string.gsub
local match = string.match
+local insert = table.insert
local sort = table.sort
local utf8_char = unicode.utf8.char
@@ -316,6 +317,8 @@ local function formatlualog(logfile, newfile)
-- The first time a new font is used, it shows up
-- as being cached
line = gsub(line, "(save cache:", "(load cache:")
+ -- Changes in PDF specials
+ line = gsub(line, "\\pdfliteral origin", "\\pdfliteral")
-- A function to handle the box prefix part
local function boxprefix(s)
return gsub(match(s, "^(%.+)"), "%.", "%%.")
@@ -543,9 +546,7 @@ function compare_pdf(name, engine)
if not refpdffile then
return
end
- if os_type == "windows" then
- refpdffile = unix_to_win(refpdffile)
- end
+ refpdffile = unix_to_win(refpdffile)
errorlevel = execute(
os_cmpexe .. " " .. refpdffile .. " " .. pdffile .. " > " .. cmpfile
)
@@ -564,9 +565,6 @@ function compare_tlg(name, engine)
if not tlgfile then
return
end
- if os_type == "windows" then
- tlgfile = unix_to_win(tlgfile)
- 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"
@@ -575,16 +573,16 @@ function compare_tlg(name, engine)
and stdengine ~= "luajittex"
then
local luatlgfile = testdir .. "/" .. name .. ".luatex" .. tlgext
- if os_type == "windows" then
- luatlgfile = unix_to_win(luatlgfile)
- end
formatlualog(tlgfile, luatlgfile)
formatlualog(logfile, logfile)
-- This allows code sharing below: we only need the .tlg name in one place
tlgfile = luatlgfile
end
errorlevel = execute(
- os_diffexe .. " " .. tlgfile .. " " .. logfile .. " > " .. difffile
+ os_diffexe .. " "
+ .. unix_to_win(tlgfile) .. " "
+ .. unix_to_win(logfile) .. " > "
+ .. unix_to_win(difffile)
)
if errorlevel == 0 then
os.remove(difffile)
@@ -717,17 +715,43 @@ function check(names)
-- No names passed: find all test files
if not next(names) then
for _,i in pairs(filelist(testfiledir, "*" .. lvtext)) do
- table.insert(names, jobname(i))
+ insert(names, jobname(i))
end
for _,i in ipairs(filelist(unpackdir, "*" .. lvtext)) do
if fileexists(testfiledir .. "/" .. i) then
print("Duplicate test file: " .. i)
return 1
else
- table.insert(names, jobname(i))
+ insert(names, jobname(i))
end
end
sort(names)
+ -- Deal limiting range of names
+ if options["first"] then
+ local allnames = names
+ local active = false
+ local firstname = options["first"]
+ names = { }
+ for _,name in ipairs(allnames) do
+ if name == firstname then
+ active = true
+ end
+ if active then
+ insert(names,name)
+ end
+ end
+ end
+ if options["last"] then
+ local allnames = names
+ local lastname = options["last"]
+ names = { }
+ for _,name in ipairs(allnames) do
+ insert(names,name)
+ if name == lastname then
+ break
+ end
+ end
+ end
end
-- https://stackoverflow.com/a/32167188
local function shuffle(tbl)