[latex3-commits] [git/LaTeX3-latex3-l3build] regenerate: Small improvements (ce84c1e)

Marcel Fabian Krüger tex at 2krueger.de
Fri May 28 20:55:00 CEST 2021


Repository : https://github.com/latex3/l3build
On branch  : regenerate
Link       : https://github.com/latex3/l3build/commit/ce84c1e9316ea8c97d815c2a9832f204f314bb12

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

commit ce84c1e9316ea8c97d815c2a9832f204f314bb12
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri May 28 20:55:00 2021 +0200

    Small improvements


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

ce84c1e9316ea8c97d815c2a9832f204f314bb12
 l3build-check.lua | 86 +++++++++++++++++++++++++++----------------------------
 l3build.dtx       | 12 ++++----
 l3build.lua       |  0
 3 files changed, 50 insertions(+), 48 deletions(-)

diff --git a/l3build-check.lua b/l3build-check.lua
index 1ab3c8f..80d6c74 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -853,6 +853,49 @@ function testexists(test)
   end
 end
 
+-- A short auxiliary to print the list of differences for check
+local function showsavecommands(failurelist)
+  local savecmds = {}
+  local checkcmd = "l3build check --show-save-cmds"
+  local prefix = "l3build save"
+  if options.config and options.config[1] ~= 'build' then
+    local config = " -c " .. options.config[1]
+    prefix = prefix .. config
+    checkcmd = checkcmd .. config
+  end
+  for name, engines in pairs(failurelist) do
+    for i = 1, #engines do
+      local engine = engines[i]
+      local cmd = savecmds[engine]
+      if not cmd then
+        if engine == stdengine then
+          cmd = prefix
+        else
+          cmd = prefix .. " -e " .. engine
+        end
+      end
+      savecmds[engine] = cmd .. " " .. name
+      if engine == stdengine then
+        checkcmd = checkcmd .. " " .. name
+      end
+    end
+  end
+  print("  To regenerate the test files, run\n")
+  local f = open(testdir .. "/.savecommands", "w")
+  for _, cmds in pairs(savecmds) do
+    print("    " .. cmds)
+    f:write(cmds, "\n")
+  end
+  f:write"\n"
+  if savecmds[stdengine] then
+     print("\n  Afterwards test for engine specific changes using\n")
+     print("    " .. checkcmd)
+     f:write(checkcmd)
+  end
+  f:close()
+  print("")
+end
+
 function check(names)
   local errorlevel = 0
   if testfiledir ~= "" and direxists(testfiledir) then
@@ -981,49 +1024,6 @@ function checkdiff()
   print("")
 end
 
--- A short auxiliary to print the list of differences for check
-function showsavecommands(failurelist)
-  local savecmds = {}
-  local hascheckcmd, checkcmd = false, "l3build check --show-save-cmds"
-  local prefix = "l3build save"
-  if options.config and options.config[1] ~= 'build' then
-    local config = " -c " .. options.config[1]
-    prefix = prefix .. config
-    checkcmd = checkcmd .. config
-  end
-  for name, engines in pairs(failurelist) do
-    for i = 1, #engines do
-      local engine = engines[i]
-      local cmd = savecmds[engine]
-      if not cmd then
-        if engine == stdengine then
-          cmd = prefix
-        else
-          cmd = prefix .. " -e " .. engine
-        end
-      end
-      savecmds[engine] = cmd .. " " .. name
-      if engine == stdengine then
-        hascheckcmd, checkcmd = true, checkcmd .. " " .. name
-      end
-    end
-  end
-  print("  To regenerate the test files, run\n")
-  local f = open(testdir .. "/.savecommands", "w")
-  for _, cmds in pairs(savecmds) do
-    print("    " .. cmds)
-    f:write(cmds, "\n")
-  end
-  f:write"\n"
-  if hascheckcmd then
-     print("\n  Afterwards test for engine specific changes using\n")
-     print("    " .. checkcmd)
-     f:write(checkcmd)
-  end
-  f:close()
-  print("")
-end
-
 function showfailedlog(name)
   print("\nCheck failed with log file")
   for _,i in ipairs(filelist(testdir, name..".log")) do
diff --git a/l3build.dtx b/l3build.dtx
index fa7bbef..7d9e61c 100644
--- a/l3build.dtx
+++ b/l3build.dtx
@@ -1130,11 +1130,13 @@
 % In these cases, the option |--show-save-cmds| can be passed to
 % |l3build check| in order to generate a list of |l3build save| commands which
 % can be executed to regenerate the expected output of all tests which fail.
-% If engine specific tests are present, there can still be some test failures
-% after running these commands. In that case, running |l3build check| with
-% |--show-save-cmds| again followed by executing the generated list of
-% |l3build save| commands will regenerate the remaining tests. It is never
-% required to run this for a third time.
+% Additionally it sometimes prints a list of |l3build check| commands for tests
+% which might still fail due to engine differences after running the |save|
+% commands. After running all these |l3build check| commands and all
+% |l3build save| commands listed by them, all tests will succeed.
+%
+% When bundles are used |l3build check --show-save-cmds| has to be executed
+% separately for every module in the bundle.
 %
 % This option is potentially dangerous and therefore should only be used with
 % care. It can easily hide valid test failures between a bunch of spurious
diff --git a/l3build.lua b/l3build.lua
old mode 100644
new mode 100755





More information about the latex3-commits mailing list.