Skip to content

Commit

Permalink
Short-circuit check --rerun if testdir doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
muzimuzhi committed Nov 6, 2023
1 parent 9a53611 commit 5a84fce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ this project uses date-based 'snapshot' version identifiers.
### Changed
- Document default value of `ctanpkg` as a valid lua expression

### Fixed
- Short-circuit `check --rerun` if `testdir` doesn't exist

## [2023-11-01]

### Changed
Expand Down
9 changes: 8 additions & 1 deletion l3build-check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,14 @@ end
function check(names)
local errorlevel = 0
if testfiledir ~= "" and direxists(testfiledir) then
if not options["rerun"] then
if options["rerun"] then
-- direxists() returns a boolean, not integer
errorlevel = direxists(testdir) and 0 or 1
if errorlevel ~= 0 then
print("\n Test directory \"" .. testdir .. "\" doesn't exist. Try again without \"--rerun\".\n")
return errorlevel
end
else
errorlevel = checkinit()
if errorlevel ~= 0 then
return errorlevel
Expand Down

0 comments on commit 5a84fce

Please sign in to comment.