[latex3-commits] [latex3/l3build] main: Short-circuit `check --rerun` if `testdir` doesn't exist (6014344)

github at latex-project.org github at latex-project.org
Mon Nov 6 08:33:42 CET 2023


Repository : https://github.com/latex3/l3build
On branch  : main
Link       : https://github.com/latex3/l3build/commit/601434456daa5ccff9db00efe214ee45796019c4

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

commit 601434456daa5ccff9db00efe214ee45796019c4
Author: Yukai Chou <muzimuzhi at gmail.com>
Date:   Mon Nov 6 12:14:46 2023 +0800

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


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

601434456daa5ccff9db00efe214ee45796019c4
 CHANGELOG.md      | 3 +++
 l3build-check.lua | 8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 01371c4..70f4b1e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,9 @@ this project uses date-based 'snapshot' version identifiers.
 - Document default value of `ctanpkg` as a valid lua expression
 - Improve log for failed checks with no diff files
 
+### Fixed
+- Short-circuit `check --rerun` if `testdir` doesn't exist
+
 ## [2023-11-01]
 
 ### Changed
diff --git a/l3build-check.lua b/l3build-check.lua
index 91db26a..5005042 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -926,7 +926,13 @@ end
 function check(names)
   local errorlevel = 0
   if testfiledir ~= "" and direxists(testfiledir) then
-    if not options["rerun"] then
+    if options["rerun"] then
+      if not direxists(testdir) then
+        print("\n  Test directory \"" .. testdir .. "\" doesn't exist.")
+        print("  Try again without \"--rerun\".\n")
+        return 1
+      end
+    else
       errorlevel = checkinit()
       if errorlevel ~= 0 then
         return errorlevel





More information about the latex3-commits mailing list.