[latex3-commits] [git/LaTeX3-latex3-l3build] main: Run engine sanity check per config (06dfccb)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Feb 26 09:36:07 CET 2023


Repository : https://github.com/latex3/l3build
On branch  : main
Link       : https://github.com/latex3/l3build/commit/06dfccbccee2e3f47063cda4d8f376d49da04c57

>---------------------------------------------------------------

commit 06dfccbccee2e3f47063cda4d8f376d49da04c57
Author: Yukai Chou <muzimuzhi at gmail.com>
Date:   Thu Feb 23 18:39:11 2023 +0800

    Run engine sanity check per config


>---------------------------------------------------------------

06dfccbccee2e3f47063cda4d8f376d49da04c57
 CHANGELOG.md          |  3 +++
 l3build-arguments.lua |  8 ++++----
 l3build.lua           | 37 ++++++++++++++++++++-----------------
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc3ce33..1706581 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Run engine sanity check per config
+
 ### Fixed
 - Restore epoch settings for `dvitopdf()`
 - Use plural form of variable `ps2pdfopts` consistently in code and doc, and 
diff --git a/l3build-arguments.lua b/l3build-arguments.lua
index 49c80a7..76b661e 100644
--- a/l3build-arguments.lua
+++ b/l3build-arguments.lua
@@ -291,16 +291,16 @@ end
 options = argparse()
 
 -- Sanity check
-function check_engines()
+function check_engines(config)
   if options["engine"] and not options["force"] then
-     -- Make a lookup table
-     local t = { }
+    -- 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!")
+        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)
diff --git a/l3build.lua b/l3build.lua
index ff80523..c66cd9a 100644
--- a/l3build.lua
+++ b/l3build.lua
@@ -118,9 +118,6 @@ if options["epoch"] then
 end
 epoch = normalise_epoch(epoch)
 
--- Sanity check
-check_engines()
-
 --
 -- Deal with multiple configs for tests
 --
@@ -205,22 +202,28 @@ if #checkconfigs > 1 then
   end
 end
 if #checkconfigs == 1 and
-  checkconfigs[1] ~= "build" and
   (options["target"] == "check" or options["target"] == "save" or options["target"] == "clean") then
-  local configname  = gsub(checkconfigs[1], "%.lua$", "")
-  local config = "./" .. configname .. ".lua"
-  if fileexists(config) then
-    local savedtestfiledir = testfiledir
-    dofile(config)
-    testdir = testdir .. "-" .. configname
-    -- Reset testsuppdir if required
-    if savedtestfiledir ~= testfiledir and
-      testsuppdir == savedtestfiledir .. "/support" then
-      testsuppdir = testfiledir .. "/support"
-    end
+  if checkconfigs[1] == "build" then
+    -- Sanity check for default config
+    check_engines("build.lua")
   else
-    print("Error: Cannot find configuration " ..  checkconfigs[1])
-    exit(1)
+    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
+        testsuppdir == savedtestfiledir .. "/support" then
+        testsuppdir = testfiledir .. "/support"
+      end
+    else
+      print("Error: Cannot find configuration " ..  configname .. ".lua")
+      exit(1)
+    end
   end
 end
 





More information about the latex3-commits mailing list.