[latex3-commits] [git/LaTeX3-latex3-l3build] master: Testing an idea .. this might vanish (3ca0d88)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Jul 31 14:41:46 CEST 2018


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

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

commit 3ca0d88f6ed06ecfbd3f3360b6591168d795e7f0
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Jul 31 13:41:46 2018 +0100

    Testing an idea .. this might vanish


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

3ca0d88f6ed06ecfbd3f3360b6591168d795e7f0
 CHANGELOG.md            |    2 +-
 l3build-check.lua       |   40 +++++-----------------------------------
 testfiles/00-test-2.tpf |  Bin 2726 -> 9798 bytes
 3 files changed, 6 insertions(+), 36 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 734626c..363e5b6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,7 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
   `main()`
 
 ### Changed
-- PDF-based testing now uses 'digested' PDF file for comparison,
+- PDF-based testing now uses PDF file for comparison,
   working from dedicated .pvt input files
 
 ### Removed
diff --git a/l3build-check.lua b/l3build-check.lua
index 38ea7dd..947563c 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -485,31 +485,6 @@ local function formatlualog(logfile, newfile, luatex)
   close(newfile)
 end
 
-local function normalise_pdf(pdffile,npdffile)
-  local file = assert(open(pdffile, "rb"))
-  local contents = gsub(file:read("*all") .. "\n", "\r\n", "\n")
-  close(file)
-  local newcontent = ""
-  local skip = false
-  for line in gmatch(contents, "([^\n]*)\n") do
-    if skip then
-      if match(line,"endstream") then
-        skip = false
-        line = ""
-      end
-    elseif match(line,"currentfile eexec") then
-      skip = true
-    end
-    if not match(line, "^ *$") and not skip then
-      newcontent = newcontent .. line .. os_newline
-    end
-  end 
-  local newfile = open(npdffile, "w")
-  output(newfile)
-  write(newcontent)
-  close(newfile)
-end
-
 -- Run one test which may have multiple engine-dependent comparisons
 -- Should create a difference file for each failed test
 function runcheck(name, hide)
@@ -594,10 +569,9 @@ end
 
 function compare_pdf(name,engine,cleanup)
   local errorlevel
-  local testname = name .. "." .. engine
   local difffile = testdir .. "/" .. name .. os_diffext
-  local pdffile  = testdir .. "/" .. testname .. pdfext
-  local tpffile  = testdir .. "/" .. name .. tpfext
+  local pdffile  = testdir .. "/" .. name.. pdfext
+  local tpffile  = testdir .. "/" .. name.. tpfext
   if not tpffile then
     return 1
   end
@@ -703,7 +677,6 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
   local logfile = testdir .. "/" .. name .. logext
   local newfile = testdir .. "/" .. name .. "." .. engine .. logext
   local pdffile = testdir .. "/" .. name .. pdfext
-  local npffile = testdir .. "/" .. name .. "." .. engine .. pdfext
   local asciiopt = ""
   for _,i in ipairs(asciiengines) do
     if realengine == i then
@@ -740,7 +713,6 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
     -- Break the loop if the result is stable
     if breakout and i < checkruns then
       if pdfmode then
-        normalise_pdf(pdffile,npffile)
         if compare_pdf(name,engine,true) == 0 then
           break
         end
@@ -755,9 +727,7 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
   if pdfmode and fileexists(testdir .. "/" .. name .. dviext) then
     dvitopdf(name, testdir, engine, hide)
   end
-  if pdfmode then
-    normalise_pdf(pdffile,npffile)
-  else
+  if not pdfmode then
     formatlog(logfile, newfile, engine, errlevels)
   end
   -- Store secondary files for this engine
@@ -928,10 +898,10 @@ function save(names)
         else
           -- Create one .tpf file
           print("Creating and copying " .. tpfext)
+          local pdffile  = name .. pdfext
           local tpffile  = name .. tpfext
-          local newfile  = name .. "." .. engine .. pdfext
           runtest(name,engine,false,pvtext,true)
-          ren(testdir,newfile,tpffile)
+          ren(testdir,pdffile,tpffile)
           cp(tpffile,testdir,testfiledir)
         end
         return 0
diff --git a/testfiles/00-test-2.tpf b/testfiles/00-test-2.tpf
index 2eecdb4..260cae0 100644
Binary files a/testfiles/00-test-2.tpf and b/testfiles/00-test-2.tpf differ





More information about the latex3-commits mailing list