Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log for failed checks with no diff files #317

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.

### Changed
- Document default value of `ctanpkg` as a valid lua expression
- Improve log for failed checks with no diff files

## [2023-11-01]

Expand Down
26 changes: 21 additions & 5 deletions l3build-check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ function check(names)
end
end
if errorlevel ~= 0 then
checkdiff()
checkdiff() -- this leaves "config" parameter of "checkdiff()" nil
if options["show-saves"] then
showsavecommands(failurelist)
end
Expand All @@ -1043,10 +1043,26 @@ function check(names)
end

-- A short auxiliary to print the list of differences for check
function checkdiff()
print("\n Check failed with difference files")
for _,i in ipairs(ordered_filelist(testdir, "*" .. os_diffext)) do
print(" - " .. testdir .. "/" .. i)
function checkdiff(config)
local diff_files = ordered_filelist(testdir, "*" .. os_diffext)
if next(diff_files) then
if config then
print("Failed tests for configuration \"" .. config .. "\":")
local testdir = testdir
if config ~= "build" then
testdir = testdir .. "-" .. config
end
end
print("\n Check failed with difference files")
for _,i in ipairs(diff_files) do
print(" - " .. testdir .. "/" .. i)
end
else
if config then
print("Check failed for configuration \"" .. config .. "\" with no difference files.")
else
print("Check failed with no difference files.")
end
end
print("")
end
Expand Down
11 changes: 1 addition & 10 deletions l3build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,7 @@ if #checkconfigs > 1 then
end
if next(failed) then
for _,config in ipairs(failed) do
print("Failed tests for configuration \"" .. config .. "\":")
print("\n Check failed with difference files")
local testdir = testdir
if config ~= "build" then
testdir = testdir .. "-" .. config
end
for _,i in ipairs(ordered_filelist(testdir,"*" .. os_diffext)) do
print(" - " .. testdir .. "/" .. i)
end
print("")
checkdiff(config)
end
if options["show-saves"] then
local savecmds, recheckcmds = "", ""
Expand Down