Skip to content

Commit

Permalink
Retain errorlevel on Windows during check target
Browse files Browse the repository at this point in the history
See #324.
  • Loading branch information
josephwright committed Dec 11, 2023
1 parent 809e98e commit 35555b9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ this project uses date-based 'snapshot' version identifiers.

### Fixed
- Short-circuit `check --rerun` if `testdir` doesn't exist
- Retain errorlevel on Windows during `check` target

## [2023-11-01]

Expand Down
40 changes: 24 additions & 16 deletions l3build-check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -799,29 +799,37 @@ function runtest(name, engine, hide, ext, test_type, breakout)
-- Ensure there is no stray .log file
rmfile(testdir,name .. logext)
local errlevels = {}
local preamble =
-- No use of localdir here as the files get copied to testdir:
-- avoids any paths in the logs
os_setenv .. " TEXINPUTS=." .. localtexmf()
.. (checksearch and os_pathsep or "")
.. os_concat ..
os_setenv .. " LUAINPUTS=." .. localtexmf()
.. (checksearch and os_pathsep or "")
.. os_concat ..
-- ensure epoch settings
set_epoch_cmd(epoch, forcecheckepoch) ..
-- Ensure lines are of a known length
os_setenv .. " max_print_line=" .. maxprintline
.. os_concat
for i = 1, checkruns do
errlevels[i] = runcmd(
-- No use of localdir here as the files get copied to testdir:
-- avoids any paths in the logs
os_setenv .. " TEXINPUTS=." .. localtexmf()
.. (checksearch and os_pathsep or "")
.. os_concat ..
os_setenv .. " LUAINPUTS=." .. localtexmf()
.. (checksearch and os_pathsep or "")
.. os_concat ..
-- ensure epoch settings
set_epoch_cmd(epoch, forcecheckepoch) ..
-- Ensure lines are of a known length
os_setenv .. " max_print_line=" .. maxprintline
.. os_concat ..
preamble ..
binary .. format
.. " " .. asciiopt .. " " .. checkopts
.. setup(lvtfile)
.. (hide and (" > " .. os_null) or "")
.. os_concat ..
runtest_tasks(jobname(lvtfile),i),
.. (hide and (" > " .. os_null) or ""),
testdir
)
-- On Windows, concatenting here will suppress any non-zero errorlevel
-- from the main run, so we split into two parts.
if errlevels[i] == 0 then
local errorlevel =
runcmd(preamble .. runtest_tasks(jobname(lvtfile),i)
.. (hide and (" > " .. os_null) or ""),testdir)
if errorlevel ~= 0 then errlevels[i] = errorlevel end
end
-- Break the loop if the result is stable
if breakout and i < checkruns then
if test_type.generated == pdfext then
Expand Down

0 comments on commit 35555b9

Please sign in to comment.