diff options
author | Norbert Preining <norbert@preining.info> | 2024-10-09 03:04:31 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-10-09 03:04:31 +0000 |
commit | 2fdd6360b8943e29f7f2beb9c820913c3e2b3783 (patch) | |
tree | 4ec568f2f0bb86ef000fdc4a4f4822718fbd8801 /macros/latex/contrib/l3build/l3build-check.lua | |
parent | e84c1272f5d94f43b893ba3b6b66e9dbf59218e1 (diff) |
CTAN sync 202410090304
Diffstat (limited to 'macros/latex/contrib/l3build/l3build-check.lua')
-rw-r--r-- | macros/latex/contrib/l3build/l3build-check.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/macros/latex/contrib/l3build/l3build-check.lua b/macros/latex/contrib/l3build/l3build-check.lua index d6d30e3e2a..a0c1ba7c7e 100644 --- a/macros/latex/contrib/l3build/l3build-check.lua +++ b/macros/latex/contrib/l3build/l3build-check.lua @@ -95,10 +95,10 @@ function checkinit_hook() return 0 end local function rewrite(source,result,processor,...) local file = assert(open(source,"rb")) - local content = gsub(file:read("*all") .. "\n","\r\n","\n") + local content = gsub(file:read("a") .. "\n","\r\n","\n") close(file) local new_content = processor(content,...) - local newfile = open(result,"w") + local newfile = assert(open(result,"w")) output(newfile) write(new_content) close(newfile) @@ -828,9 +828,9 @@ function runtest(name, engine, hide, ext, test_type, breakout) ) -- On Windows, concatenating here will suppress any non-zero errorlevel -- from the main run, so we split into two parts. - if runtest_tasks(jobname(lvtfile),i) ~= "" then - local errorlevel = - runcmd(preamble .. runtest_tasks(jobname(lvtfile),i),testdir) + local tasks = runtest_tasks(jobname(lvtfile),i) + if tasks ~= "" then + local errorlevel = runcmd(preamble .. tasks,testdir) if errorlevel ~= 0 then errlevels[i] = errorlevel end end -- Break the loop if the result is stable @@ -919,7 +919,7 @@ local function showsavecommands(failurelist) end end print(" To regenerate the test files, run\n") - local f = open(testdir .. "/.savecommands", "w") + local f = assert(open(testdir .. "/.savecommands", "w")) for _, cmds in pairs(savecmds) do print(" " .. cmds) f:write(cmds, "\n") @@ -1089,9 +1089,9 @@ function showfailedlog(name) for _,i in ipairs(ordered_filelist(testdir, name..".log")) do print(" - " .. testdir .. "/" .. i) print("") - local f = open(testdir .. "/" .. i,"r") - local content = f:read("*all") - close(f) + local f = assert(open(testdir .. "/" .. i,"r")) + local content = f:read("a") + f:close() print("-----------------------------------------------------------------------------------") print(content) print("-----------------------------------------------------------------------------------") @@ -1103,9 +1103,9 @@ function showfaileddiff() for _,i in ipairs(ordered_filelist(testdir, "*" .. os_diffext)) do print(" - " .. testdir .. "/" .. i) print("") - local f = open(testdir .. "/" .. i,"r") - local content = f:read("*all") - close(f) + local f = assert(open(testdir .. "/" .. i,"r")) + local content = f:read("a") + f:close() print("-----------------------------------------------------------------------------------") print(content) print("-----------------------------------------------------------------------------------") |