Skip to content

Commit

Permalink
Drop switch --force|-f
Browse files Browse the repository at this point in the history
Unknown engines are then skipped with a message,
rather than leading to an error.
  • Loading branch information
josephwright committed Jan 18, 2024
1 parent 02dbcfc commit b489934
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 41 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ this project uses date-based 'snapshot' version identifiers.
### Added
- Switch `-s|--stdengine` to run a set of tests only with the standard engine
even where this varies between configs (issue \#343)

### Removed
- Switch `--force|-f`

## [2024-01-09]

### Fixed
Expand Down
28 changes: 0 additions & 28 deletions l3build-arguments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ option_list =
desc = "Name of first test to run",
type = "string"
},
force =
{
desc = "Forces tests to run, even if engine is not set up",
short = "f",
type = "boolean"
},
full =
{
desc = "Installs all files",
Expand Down Expand Up @@ -295,25 +289,3 @@ local function argparse()
end

options = argparse()

-- Sanity check
function check_engines(config)
if options["engine"] and not options["force"] then
-- Make a lookup table
local t = { }
for _, engine in pairs(checkengines) do
t[engine] = true
end
for _, engine in pairs(options["engine"]) do
if not t[engine] then
print("\n! Error: Engine \"" .. engine .. "\" not set up for testing with configuration \"" .. config .. "\"!")
print("\n Valid values are:")
for _, engine in ipairs(checkengines) do
print(" - " .. engine)
end
print("")
exit(1)
end
end
end
end
13 changes: 12 additions & 1 deletion l3build-check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,18 @@ function runcheck(name, hide)
if options["stdengine"] then
checkengines = {stdengine}
elseif options["engine"] then
checkengines = options["engine"]
local t = {}
for _,engine in ipairs(checkengines) do
t[engine] = true
end
checkengines = {}
for _,engine in ipairs(options["engine"]) do
if t[engine] then
insert(checkengines,engine)
else
print("Skipping unknown engine " .. engine)
end
end
end
local failedengines = {}
-- Used for both .lvt and .pvt tests
Expand Down
2 changes: 0 additions & 2 deletions l3build.1
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ Sets the epoch for tests and typesetting
Takes the upload announcement from the given file
.IP --first
Name of first test to run
.IP --force|-f
Force tests to run if engine is not set up
.IP --full
Installs all files
.IP --halt-on-error|-H
Expand Down
4 changes: 0 additions & 4 deletions l3build.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,6 @@
% \item |--epoch| Sets the epoch for typesetting and testing
% \item |--file| (|-F|) Takes the upload announcement from the given file
% \item |--first| Name of the first test to run
% \item |--force| (|-f|) Forces checks to run even if sanity
% checks fail, \emph{e.g.}~when |--engine| is not given in
% \var{checkengines}
% \item |--full| Instructs the \texttt{install} target to include the
% \texttt{doc} and \texttt{source} trees
% \item |--halt-on-error| (|-H|) Specifies that checks
Expand Down Expand Up @@ -1676,7 +1673,6 @@
% \var{epoch} & String \\
% \var{file} & string \\
% \var{first} & Boolean \\
% \var{force} & Boolean \\
% \var{full} & Boolean \\
% \var{halt-on-error} & Boolean \\
% \var{help} & Boolean \\
Expand Down
7 changes: 1 addition & 6 deletions l3build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,12 @@ if #checkconfigs > 1 then
end
if #checkconfigs == 1 and
(options["target"] == "check" or options["target"] == "save" or options["target"] == "clean") then
if checkconfigs[1] == "build" then
-- Sanity check for default config
check_engines("build.lua")
else
if not checkconfigs[1] == "build" then
local configname = gsub(checkconfigs[1], "%.lua$", "")
local config = "./" .. configname .. ".lua"
if fileexists(config) then
local savedtestfiledir = testfiledir
dofile(config)
-- Sanity check for non-default config
check_engines(configname .. ".lua")
testdir = testdir .. "-" .. configname
-- Reset testsuppdir if required
if savedtestfiledir ~= testfiledir and
Expand Down

0 comments on commit b489934

Please sign in to comment.