Skip to content

Commit

Permalink
allow for outputing error level to tlg file
Browse files Browse the repository at this point in the history
This allows, e.g., a failure in code to be detected even if it doesn't lead to a change in the log file output capture between TIMO/OMIT.

Disabled by default for backwards compatibility.
  • Loading branch information
wspr authored and josephwright committed Sep 12, 2017
1 parent a337a6b commit 3ce8a61
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions l3build.lua
Expand Up @@ -177,6 +177,7 @@ packtdszip = packtdszip or false
scriptname = scriptname or "build.lua"
typesetcmds = typesetcmds or ""
versionform = versionform or ""
recorderrorlevel = recorderrorlevel or false
-- Extensions for various file types: used to abstract out stuff a bit
bakext = bakext or ".bak"
Expand Down Expand Up @@ -934,7 +935,7 @@ end
-- Convert the raw log file into one for comparison/storage: keeps only
-- the 'business' part from the tests and removes system-dependent stuff
local function formatlog(logfile, newfile, engine)
local function formatlog(logfile, newfile, engine, errlevels)
local maxprintline = maxprintline
if engine == "luatex" or engine == "luajittex" then
maxprintline = maxprintline + 1 -- Deal with an out-by-one error
Expand Down Expand Up @@ -1066,6 +1067,16 @@ local function formatlog(logfile, newfile, engine)
local newfile = open(newfile, "w")
output(newfile)
write(newlog)
if recorderrorlevel then
write('***************\n')
for i = 1, checkruns do
if errlevels[i] == 0 then
write('Run ' .. i .. ' executed without error')
else
write('Run ' .. i .. ' executed with error level ' .. errlevels[i] )
end
end
end
close(newfile)
end
Expand Down Expand Up @@ -1500,8 +1511,9 @@ function runtest(name, engine, hide, ext, makepdf)
break
end
end
local errlevels = {}
for i = 1, checkruns do
run(
errlevels[i] = run(
testdir,
-- No use of localdir here as the files get copied to testdir:
-- avoids any paths in the logs
Expand All @@ -1524,7 +1536,7 @@ function runtest(name, engine, hide, ext, makepdf)
if makepdf and fileexists(testdir .. "/" .. name .. dviext) then
dvitopdf(name, testdir, engine, hide)
end
formatlog(logfile, newfile, engine)
formatlog(logfile, newfile, engine, errlevels)
-- Store secondary files for this engine
for _,i in ipairs(filelist(testdir, name .. ".???")) do
local ext = match(i, "%....")
Expand Down

0 comments on commit 3ce8a61

Please sign in to comment.