[latex3-commits] [git/LaTeX3-latex3-l3build] master: Clean up after compare_tlg() (cdf1e6c)

Joseph Wright joseph.wright at morningstar2.co.uk
Sat Mar 24 09:10:48 CET 2018


Repository : https://github.com/latex3/l3build
On branch  : master
Link       : https://github.com/latex3/l3build/commit/cdf1e6cc7ae6d2364c0dc6e8a9b862ad0dd8f7a2

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

commit cdf1e6cc7ae6d2364c0dc6e8a9b862ad0dd8f7a2
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sat Mar 24 08:10:48 2018 +0000

    Clean up after compare_tlg()
    
    This is required for the LuaTeX code.


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

cdf1e6cc7ae6d2364c0dc6e8a9b862ad0dd8f7a2
 l3build-check.lua |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/l3build-check.lua b/l3build-check.lua
index 7129a0d..f378893 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -589,7 +589,7 @@ function compare_pdf(name, engine)
   return errorlevel
 end
 
-function compare_tlg(name, engine)
+function compare_tlg(name, engine,cleanup)
   local errorlevel
   local testname = name .. "." .. engine
   local difffile = testdir .. "/" .. testname .. os_diffext
@@ -605,15 +605,24 @@ function compare_tlg(name, engine)
     and stdengine ~= "luatex"
     and stdengine ~= "luajittex"
     then
-    local luatlgfile = testdir .. "/" .. name .. ".luatex" ..  tlgext
+    local lualogfile = logfile
+    if cleanup then
+      lualogfile = testdir .. "/" .. testname .. ".tmp" .. logext
+    end
+    local luatlgfile = testdir .. "/" .. testname .. tlgext
     formatlualog(tlgfile, luatlgfile, false)
-    formatlualog(logfile, logfile, true)
-    -- This allows code sharing below: we only need the .tlg name in one place
-    tlgfile = luatlgfile
+    formatlualog(logfile, lualogfile, true)
+    errorlevel = execute(os_diffexe .. " "
+      .. normalize_path(luatlgfile .. " " .. lualogfile .. " > " .. difffile))
+    if cleanup then
+      remove(lualogfile)
+      remove(luatlgfile)
+    end
+  else
+    errorlevel = execute(os_diffexe .. " "
+      .. normalize_path(tlgfile .. " " .. logfile .. " > " .. difffile))
   end
-  errorlevel = execute(os_diffexe .. " "
-    .. normalize_path(tlgfile .. " " .. logfile .. " > " .. difffile))
-  if errorlevel == 0 then
+  if errorlevel == 0 or cleanup then
     remove(difffile)
   end
   return errorlevel
@@ -705,7 +714,7 @@ function runtest(name, engine, hide, ext, makepdf, breakout)
     -- Break the loop if the result is stable
     if breakout and i < checkruns then
       formatlog(logfile, newfile, engine, errlevels)
-      if compare_tlg(name,engine) == 0 then
+      if compare_tlg(name,engine,true) == 0 then
         break
       end
     end





More information about the latex3-commits mailing list