texlive[41469] Master/texmf-dist: l3build (17Jun)

commits+preining at tug.org commits+preining at tug.org
Fri Jun 17 17:17:17 CEST 2016


Revision: 41469
          http://tug.org/svn/texlive?view=revision&revision=41469
Author:   preining
Date:     2016-06-17 17:17:17 +0200 (Fri, 17 Jun 2016)
Log Message:
-----------
l3build (17Jun)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/l3build/README.md
    trunk/Master/texmf-dist/doc/latex/l3build/l3build.pdf
    trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx
    trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua
    trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex

Modified: trunk/Master/texmf-dist/doc/latex/l3build/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/l3build/README.md	2016-06-17 10:20:33 UTC (rev 41468)
+++ trunk/Master/texmf-dist/doc/latex/l3build/README.md	2016-06-17 15:17:17 UTC (rev 41469)
@@ -1,7 +1,7 @@
 l3build: a testing and building system for LaTeX3
 =================================================
 
-Release 2016/03/26 (r6466)
+Release 2016/06/14 (r6608)
 
 Overview
 --------

Modified: trunk/Master/texmf-dist/doc/latex/l3build/l3build.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx	2016-06-17 10:20:33 UTC (rev 41468)
+++ trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx	2016-06-17 15:17:17 UTC (rev 41469)
@@ -39,12 +39,11 @@
 \RequirePackage{expl3}
 \def\ExplFileName{l3build}
 \def\ExplFileDescription{L3 Regression test suite}
-\def\ExplFileDate{2016/03/26}
-\def\ExplFileVersion{6466}
+\def\ExplFileDate{2016/06/14}
+\def\ExplFileVersion{6608}
 \documentclass[full]{l3doc}
 \renewcommand\partname{Part}
 \usepackage{multicol,needspace}
-
 \makeatletter
 \addtolength\columnsep{1em}
 \renewcommand\columnseprule{0.4pt}
@@ -58,7 +57,6 @@
   \@nobreakfalse
   \end{multicols}}
 \makeatother
-
 \newenvironment{buildcmd}[1]{%
   \bigskip\par\noindent\hspace{-\parindent}%
   \fbox{\ttfamily \textcolor[gray]{0.5}{\$} texlua build.lua #1}%
@@ -114,10 +112,13 @@
 \luavarset{versionfiles}    {\{"*.dtx"\}} {Files for automatic version editing.}
 \luavarseparator
 \luavarset{bakext} {".bak"} {Extension of backup files.}
+\luavarset{dviext} {".dvi"} {Extension of DVI files.}
 \luavarset{lvtext} {".lvt"} {Extension of test files.}
 \luavarset{tlgext} {".tlg"} {Extension of test file output.}
 \luavarset{lvtext} {".lve"} {Extension of auto-generating test file output.}
 \luavarset{logext} {".log"} {Extension of checking output, before processing it into a \texttt{.tlg}.}
+\luavarset{pdfext} {".pdf"} {Extension of PDF file for checking and saving.}
+\luavarset{psext}  {".ps"}  {Extension of PostScript files.}
 \luavarseparator
 \luavarset{checkdeps}   {\{~\}} {List of build unpack dependencies for checking.}
 \luavarset{typesetdeps} {\{~\}} {\dots for typesetting docs.}
@@ -154,6 +155,7 @@
 \luavarseparator
 \luavarset{asciiengines}{\{"pdftex"\}}{Engines which should log as sure ASCII}
 \luavarset{checkruns}   {1}           {How many times to run a check file before comparing the log.}
+\luavarset{epoch}       {1463734800}  {Epoch (Unix date) to set for test runs.}
 \luavarset{maxprintline}{79}          {Length of line to use in log files.}
 \luavarset{packtdszip}  {false}       {Build a TDS-style zip file for CTAN?}
 \luavarset{scriptname}  {"build.lua"} {Name of script used in dependencies.}
@@ -187,10 +189,8 @@
   \end{longtable}
   \endgroup
 }
-
 \newcommand\code{\texttt}
 \newcommand\var{\texttt}
-
 \usepackage[procnames]{listings}
 \lstset{
     basicstyle=\ttfamily\small,
@@ -197,7 +197,6 @@
     numbers=left,
     numberstyle={\tiny\color[gray]{0.4}},
 }
-
 \usepackage{shortvrb}
 \usepackage{enumitem}
 \usepackage{longtable}
@@ -310,17 +309,24 @@
 % \item doc
 % \item install
 % \item save \meta{name(s)}
+% \item setversion
 % \end{itemize}
 % These commands are described below.
 %
 % As well as these commands, the system recognises the options
 % \begin{itemize}
+% \item \texttt{--date} (\texttt{-d}) Date to use when setting version
+%   data
 % \item \texttt{--engine} (\texttt{-e}) Sets the engine to use for
 %   testing
 % \item \texttt{--halt-on-error} (\texttt{-H}) Specifies that checks
 %   should stop as soon as possible, rather than running all requested
 %   tests
+% \item \texttt{--pdf} (\texttt{-p}) Test PDF file against a reference
+%   version rather than using a log comparison
 % \item \texttt{--quiet} (\texttt{-q}) Suppresses output from unpacking
+% \item \texttt{--version} (\texttt{-v}) Version string to use when setting
+%   version data
 % \end{itemize}
 %
 % \begin{buildcmd}{check}
@@ -367,6 +373,16 @@
 % testing to a single engine.
 % \end{buildcmd}
 %
+% \begin{buildcmd}{check -p}
+% Rather than the log-based checking carried out by the standard
+% |check| target, running with the |-p| option carries out a binary
+% comparison of the PDF files produced by typesetting against those
+% saved in \var{testfiledir}.
+%
+% This functionality requires \TeX{} Live 2016 or later as it needs support
+% from the engines not available in earlier releases.
+% \end{buildcmd}
+%
 % \begin{buildcmd}{cmdcheck}
 % For \cls{l3doc}-based sources, allows checking that the commands defined in the code part  (by \var{cmdchkfiles}) are documented in the description part.
 % This is performed by passing the |check| option to the \cls{l3doc} class, typesetting the file(s) to check with engine \var{stdengine} with options \var{cmdchkopts}, and checking the resultant |.cmds| file(s).
@@ -461,6 +477,15 @@
 % A normalisation process is performed when checking to avoid common differences such as register allocation; full details are listed in section~\ref{sec:norm}.
 % \end{buildcmd}
 %
+% \begin{buildcmd}{save -p \meta{name(s)}}
+% This version of |save| will store the PDF files produced from
+% \texttt{\meta{name(s)}.lvt} in addition to the |.tlg| file, and thus allows
+% binary comparison of the result of typesetting.
+%
+% This functionality requires \TeX{} Live 2016 or later as it needs support
+% from the engines not available in earlier releases.
+% \end{buildcmd}
+%
 % \begin{buildcmd}{setversion}
 % Modifies the content of files specified by |versionfiles| to allow
 % automatic updating of the file date and version. The latter are
@@ -875,6 +900,31 @@
 %   \label{fig:box-log}
 % \end{figure}
 %
+% \subsection{Additional test tasks}
+%
+% A standard test will run the file \texttt{\meta{name}.lvt} using one
+% or more engines, but will not carry out any additional processing. For
+% some tests, for example bibliography generation, it may be desirable to
+% call one or more tools in addition to the engine. This can be arranged
+% by defining |runtest_tasks|, a function taking one argument, the name
+% of the current test (this is equivalent to \TeX{}'s \cs{jobname},
+% \emph{i.e.}~it lacks an extension). The function |runtest_tasks|
+% is is into a call to the system to run the engine. As such, it
+% should take return a string with the appropriate command(s)
+% and option(s). If more than one task is required, these should be separated
+% by use of |os_concat|, a string variable defined by \pkg{l3build} as the
+% correct concatenation marker for the system. An example of |runtest_tasks|
+% suitable for calling Biber is shown in Listing~\ref{fig:test-tasks}.
+% \begin{figure}
+%   \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6]
+%     function runtest_tasks(name)
+%       return "biber " .. name
+%     end
+%   \end{lstlisting}
+%   \caption{Example \texttt{runtest_tasks} function.}
+%   \label{fig:test-tasks}
+% \end{figure}
+%
 % \section{Alternative test formats}
 %
 % \subsection{Generating test files with \pkg{DocStrip}}
@@ -956,7 +1006,7 @@
 %   \item |ExplFileName| --- Searches for lines using |\def\ExplFileName|,
 %     |\def\ExplFileDate|, \dots, formulation.
 % \end{itemize}
-% 
+%
 % For more complex cases, the programmer may directly define the
 % Lua function |setversion_update_line()|, which takes as arguments the line of the
 % source, the supplied date and the supplied version. It should return a
@@ -1091,7 +1141,6 @@
 \def\loggingoutput{\tracingoutput1
     \showboxbreadth\maxdimen\showboxdepth\maxdimen}
 %    \end{macrocode}
-
 %
 % Set the newline character: \LaTeXe{} does this but plain-based formats
 % do not.
@@ -1323,14 +1372,56 @@
   \SEPARATOR
   \LONGTYPEOUT{}%
 }
-
 \def \TRUE  {\TYPE{TRUE}}
 \def \FALSE {\TYPE{FALSE}}
 \def \YES   {\TYPE{YES}}
 \def \NO    {\TYPE{NO}}
-
 \def \NEWLINE {\TYPE{^^J}}
 %    \end{macrocode}
+%
+% \subsection{Suppressing variable data in output}
+%
+% To make any PDF file produced comparable we need to suppress various
+% pieces of data. This works in concert with setting the epoch from the
+% environment side (as not all output can be controlled here). We are
+% somewhat stuck if \texttt{dvips} is being used so just hope for the best!
+% There is a limit to what can be done with the underlying PDF structure so
+% there is no point entirely suppressing \texttt{Producer}: simply avoid
+% any version numbers.
+%    \begin{macrocode}
+\ifnum 0%
+  \ifx\pdfoutput\@undefined\else\ifnum\pdfoutput>0 1\fi\fi
+  \ifx\outputmode\@undefined\else\ifnum\outputmode>0 1\fi\fi
+  >0 %
+  \ifx\pdfvariable\@undefined
+    \pdfinfo{/Producer (\ifx\directlua\@undefined pdf\else Lua\fi TeX)}
+    \ifx\pdfinfoomitdate\@undefined\else
+      \pdfinfoomitdate     = 1 %
+      \pdfsuppressptexinfo = 1 %
+      \pdftrailerid{}
+    \fi
+  \else
+    \pdfextension info{/Producer (LuaTeX)}
+    \pdfvariable suppressoptionalinfo \numexpr
+          0
+        +   1 % PTEX.Fullbanner
+        +  32 % CreationDate
+        +  64 % ModDate
+      \relax
+  \fi
+\else
+  \special{%
+    pdf: docinfo
+      <<
+        /Creator        (TeX)
+        /CreationDate   ()
+        /ModDate        ()
+        /Producer       (\ifx\XeTeXversion\@undefined\else x\fi dvipdfmx)
+      >>
+  }
+\fi
+%    \end{macrocode}
+%
 % Finish up.
 %    \begin{macrocode}
 \reset at catcodes
@@ -1361,5 +1452,3 @@
 % \end{implementation}
 %
 % \PrintIndex
-
-

Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua	2016-06-17 10:20:33 UTC (rev 41468)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua	2016-06-17 15:17:17 UTC (rev 41469)
@@ -17,8 +17,8 @@
 --]]
 
 -- Version information: should be identical to that in l3build.dtx
-release_date = "2016/03/26"
-release_ver  = "6466"
+release_date = "2016/06/14"
+release_ver  = "6608"
 
 -- "module" is a deprecated function in Lua 5.2: as we want the name
 -- for other purposes, and it should eventually be 'free', simply
@@ -149,6 +149,7 @@
 -- Other required settings
 asciiengines = asciiengines or {"pdftex"}
 checkruns    = checkruns    or 1
+epoch        = epoch        or 1463734800
 maxprintline = maxprintline or 79
 packtdszip   = packtdszip   or false -- Not actually needed but clearer
 scriptname   = scriptname   or "build.lua" -- Script used in each directory
@@ -157,9 +158,12 @@
 
 -- Extensions for various file types: used to abstract out stuff a bit
 bakext = bakext or ".bak"
+dviext = dviext or ".dvi"
 logext = logext or ".log"
 lveext = lveext or ".lve"
 lvtext = lvtext or ".lvt"
+pdfext = pdfext or ".pdf"
+psext  = psext  or ".ps"
 tlgext = tlgext or ".tlg"
 
 -- Run time options
@@ -176,6 +180,7 @@
       ["halt-on-error"]   = "halt"   ,
       ["halt-on-failure"] = "halt"   ,
       help                = "help"   ,
+      pdf                 = "pdf" ,
       quiet               = "quiet"  ,
       version             = "version"
     }
@@ -185,6 +190,7 @@
       e = "engine" ,
       h = "help"   ,
       H = "halt"   ,
+      p = "pdf"  ,
       q = "quiet"  ,
       v = "version"
     }
@@ -194,6 +200,7 @@
       engine  = true ,
       halt    = false,
       help    = false,
+      pdf     = false,
       quiet   = false,
       version = true
     }
@@ -303,6 +310,7 @@
 optengines = userargs["engine"]
 opthalt    = userargs["halt"]
 opthelp    = userargs["help"]
+optpdf     = userargs["pdf"]
 optquiet   = userargs["quiet"]
 optversion = userargs["version"]
 
@@ -387,6 +395,8 @@
 -- the support functions
 if os.type == "windows" then
   os_ascii    = "@echo."
+  os_cmpexe   = os.getenv("cmpexe") or "fc /b"
+  os_cmpext   = os.getenv("cmpext") or ".cmp"
   os_concat   = "&"
   os_diffext  = os.getenv("diffext") or ".fc"
   os_diffexe  = os.getenv("diffexe") or "fc /n"
@@ -399,6 +409,8 @@
   os_yes      = "for /l %I in (1,1,200) do @echo y"
 else
   os_ascii    = "echo \"\""
+  os_cmpexe   = os.getenv("cmpexe") or "cmp"
+  os_cmpext   = os.getenv("cmpext") or ".cmp"
   os_concat   = ";"
   os_diffext  = os.getenv("diffext") or ".diff"
   os_diffexe  = os.getenv("diffexe") or "diff -c --strip-trailing-cr"
@@ -607,6 +619,8 @@
         .. (opthalt and " -H" or "")
         .. date
         .. engines
+        .. (optpdf and " -p" or "")
+        .. (optquiet and " -q" or "")
         .. version
     )
     if errorlevel ~= 0 then
@@ -828,7 +842,7 @@
       break
     elseif line == "OMIT" then
       skipping = true
-    elseif line == "TIMO" then
+    elseif string.match(line, "^%)?TIMO$") then
       skipping = false
     elseif not prestart and not skipping then
       line = normalize(line)
@@ -1045,8 +1059,8 @@
   return modules
 end
 
--- Runs a single test: needs the name of the test rather than the .lvt file
--- One 'test' here may apply to multiple engines
+-- Run one test which may have multiple engine-dependent comparisons
+-- Should create a difference file for each failed test
 function runcheck(name, hide)
   local checkengines = checkengines
   if optengines then
@@ -1055,67 +1069,24 @@
   local errorlevel = 0
   for _,i in ipairs(checkengines) do
     -- Allow for luatex == luajittex for .tlg purposes
-    local enginename = i
-    if i == "luajittex" then
-      enginename = "luatex"
-      newfile = testdir .. "/" .. name .. "." .. i .. logext
+    local engine = i
+    if i == "luajitex" then
+      engine = "luatex"
     end
-    local testname = name .. "." .. enginename
-    local difffile = testdir .. "/" .. testname .. os_diffext
-    local newfile  = newfile or testdir .. "/" .. testname .. logext
-    -- Use engine-specific file if available
-    local tlgfile  = locate(
-      {testfiledir, unpackdir},
-      {testname .. tlgext, name .. tlgext}
-    )
-    if tlgfile then
-      cp(name .. tlgext, testfiledir, testdir)
-    else
-      -- Attempt to generate missing test goal from expectation
-      tlgfile = testdir .. "/" .. testname .. tlgext
-      if not locate({unpackdir, testfiledir}, {name .. lveext}) then
-        print(
-          "Error: failed to find " .. tlgext .. " or "
-            .. lveext .. " file for " .. name .. "!"
-        )
-        os.exit(1)
-      end
-      runtest(name, i, hide, lveext)
-      ren(testdir, testname .. logext, testname .. tlgext)
-    end
+    setup_check(name, engine) 
     runtest(name, i, hide, lvtext)
-    if os_windows then
-      tlgfile = unix_to_win(tlgfile)
-    end
+    -- Generation of results heavily depends on test type
     local errlevel
-    -- Do additional log formatting if the engine is LuaTeX, there is no
-    -- LuaTeX-specific .tlg file and the default engine is not LuaTeX
-    if enginename == "luatex"
-      and not string.match(tlgfile, "%.luatex" .. "%" .. tlgext)
-      and stdengine ~= "luatex"
-      and stdengine ~= "luajittex" then
-      local luatlgfile = testdir .. "/" .. name .. ".luatex" ..  tlgext
-      if os_windows then
-        luatlgfile = unix_to_win(luatlgfile)
-      end
-      formatlualog(tlgfile, luatlgfile)
-      formatlualog(newfile, newfile)
-      errlevel = os.execute(
-        os_diffexe .. " " .. luatlgfile .. " " .. newfile
-          .. " > " .. difffile
-      )
+    if optpdf then
+      errlevel = compare_pdf(name, engine)
     else
-      errlevel = os.execute(
-        os_diffexe .. " " .. tlgfile .. " " .. newfile .. " > " .. difffile
-      )
+      errlevel = compare_tlg(name, engine)
     end
-    if errlevel == 0 then
-      os.remove(difffile)
-    else
-      if opthalt then
-        checkdiff()
-        return errlevel
-      end
+    if errlevel ~= 0 and opthalt then
+      checkdiff()
+      return errlevel
+    end
+    if errlevel > errorlevel then
       errorlevel = errlevel
     end
   end
@@ -1122,6 +1093,98 @@
   return errorlevel
 end
 
+function setup_check(name, engine)
+  local testname = name .. "." .. engine
+  local refext = ((optpdf and pdfext) or tlgext)
+  local reffile = locate(
+    {testfiledir, unpackdir},
+    {testname .. refext, name .. refext}
+  )
+  -- Attempt to generate missing reference file from expectation
+  if not reffile then
+    if not locate({unpackdir, testfiledir}, {name .. lveext}) then
+      print(
+        "Error: failed to find " .. refext .. " or "
+          .. lveext .. " file for " .. name .. "!"
+      )
+      os.exit(1)
+    end
+    runtest(name, engine, hide, lveext)
+    reffile = testdir .. "/" .. testname .. refext
+    if not optpdf then
+      ren(testdir, testname .. logext, testname .. tlgext)
+    end
+  else
+    cp(
+      string.match(reffile, ".*/(.*)"),
+      string.match(reffile, "(.*)/.*"),
+      testdir
+    )
+  end
+  if optpdf then
+    local reffile = string.match(reffile, ".*/(.*)")
+    ren(
+      testdir,
+      reffile,
+      string.gsub(reffile, pdfext .. "$", ".ref" .. pdfext)
+    )
+  end
+end
+
+function compare_pdf(name, engine)
+  local errorlevel
+  local testname = name .. "." .. engine
+  local cmpfile    = testdir .. "/" .. testname .. os_cmpext
+  local pdffile    = testdir .. "/" .. testname .. pdfext
+  local refpdffile = locate(
+    {testdir}, {testname .. ".ref" .. pdfext, name .. ".ref" .. pdfext}
+  )
+  if os_windows then
+    refpdffile = unix_to_win(refpdffile)
+  end
+  errorlevel = os.execute(
+    os_cmpexe .. " " .. refpdffile .. " " .. pdffile .. " > " .. cmpfile
+  )
+  if errorlevel == 0 then
+    os.remove(cmpfile)
+  end
+  return errorlevel
+end
+
+function compare_tlg(name, engine)
+  local errorlevel
+  local testname = name .. "." .. engine
+  local difffile = testdir .. "/" .. testname .. os_diffext
+  local logfile  = testdir .. "/" .. testname .. logext
+  local tlgfile  = locate({testdir}, {testname .. tlgext, name .. tlgext})
+  if os_windows then
+    tlgfile = unix_to_win(tlgfile)
+  end
+  -- Do additional log formatting if the engine is LuaTeX, there is no
+  -- LuaTeX-specific .tlg file and the default engine is not LuaTeX
+  if engine == "luatex"
+    and not string.match(tlgfile, "%.luatex" .. "%" .. tlgext)
+    and stdengine ~= "luatex"
+    and stdengine ~= "luajittex"
+    then
+    local luatlgfile = testdir .. "/" .. name .. ".luatex" ..  tlgext
+    if os_windows then
+      luatlgfile = unix_to_win(luatlgfile)
+    end
+    formatlualog(tlgfile, luatlgfile)
+    formatlualog(logfile, logfile)
+    -- This allows code sharing below: we only need the .tlg name in one place
+    tlgfile = luatlgfile
+  end
+  errorlevel = os.execute(
+    os_diffexe .. " " .. tlgfile .. " " .. logfile .. " > " .. difffile
+  )
+  if errorlevel == 0 then
+    os.remove(difffile)
+  end
+  return errorlevel
+end
+
 -- Run one of the test files: doesn't check the result so suitable for
 -- both creating and verifying .tlg files
 function runtest(name, engine, hide, ext)
@@ -1154,7 +1217,9 @@
   -- Special casing for XeTeX engine
   local checkopts = checkopts
   if string.match(engine, "xetex") then
-    checkopts = checkopts .. " -no-pdf"
+    if not optpdf then
+      checkopts = checkopts .. " -no-pdf"
+    end
   end
   local logfile = testdir .. "/" .. name .. logext
   local newfile = testdir .. "/" .. name .. "." .. engine .. logext
@@ -1175,6 +1240,11 @@
       -- Avoid spurious output from (u)pTeX
       os_setenv .. " GUESS_INPUT_KANJI_ENCODING=0"
         .. os_concat ..
+      -- Fix the time of the run
+      os_setenv .. " SOURCE_DATE_EPOCH=" .. epoch
+        .. os_concat ..
+      os_setenv .. " SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1"
+        .. os_concat ..
       -- Ensure lines are of a known length
       os_setenv .. " max_print_line=" .. maxprintline
         .. os_concat ..
@@ -1181,8 +1251,15 @@
       realengine ..  format .. " "
         .. checkopts .. " " .. asciiopt .. lvtfile
         .. (hide and (" > " .. os_null) or "")
+        .. os_concat ..
+      runtest_tasks(stripext(lvtfile))
     )
   end
+  if optpdf then
+    if fileexists(testdir .. "/" .. name .. dviext) then
+      dvitopdf(name, testdir, engine, hide)
+    end
+  end
   formatlog(logfile, newfile, engine)
   -- Store secondary files for this engine
   for _,i in ipairs(filelist(testdir, name .. ".???")) do
@@ -1199,6 +1276,34 @@
   end
 end
 
+-- A hook to allow additional tasks to run for the tests
+runtest_tasks = runtest_tasks or function(name)
+  return ""
+end
+
+function dvitopdf(name, dir, engine, hide)
+  if string.match(engine, "^u?ptex$") then
+    run(
+      dir,
+      os_setenv .. " SOURCE_DATE_EPOCH=" .. epoch
+        .. os_concat ..
+     "dvipdfmx  " .. name .. dviext
+       .. (hide and (" > " .. os_null) or "")
+    )
+  else
+    run(
+      dir,
+      os_setenv .. " SOURCE_DATE_EPOCH=" .. epoch
+        .. os_concat ..
+     "dvips " .. name .. dviext
+       .. (hide and (" > " .. os_null) or "")
+       .. os_concat ..
+     "ps2pdf " .. name .. psext
+        .. (hide and (" > " .. os_null) or "")
+    )
+  end
+end
+
 -- Strip the extension from a file name (if present)
 function stripext(file)
   local name = string.match(file, "^(.*)%.")
@@ -1325,7 +1430,7 @@
         )
       end
       errorlevel = cycle(name)
-      if errorlevel ~= 0 then
+      if errorlevel == 0 then
         errorlevel = cycle(name)
       end
     end
@@ -1336,7 +1441,7 @@
 -- Standard versions of the main targets for building modules
 
 -- Simply print out how to use the build system
-help = help or function()
+function help()
   print("usage: " .. arg[0] .. " <command> [<options>] [<names>]")
   print("")
   print("The most commonly used l3build commands are:")
@@ -1361,8 +1466,9 @@
   print("   --date|-d           Sets the date to insert into sources")
   print("   --engine|-e         Sets the engine to use for running test")
   print("   --halt-on-error|-H  Stops running tests after the first failure")
+  print("   --pdf|-p            Check/save PDF files")
+  print("   --quiet|-q          Suppresses TeX output when unpacking")
   print("   --version|-v        Sets the version to insert into sources")
-  print("   --quiet|-q          Suppresses TeX output when unpacking")
   print("")
   print("See l3build.pdf for further details.")
 end
@@ -1419,6 +1525,9 @@
   for _,i in ipairs(filelist(testdir, "*" .. os_diffext)) do
     print("  - " .. testdir .. "/" .. i)
   end
+  for _,i in ipairs(filelist(testdir, "*" .. os_cmpext)) do
+    print("  - " .. testdir .. "/" .. i)
+  end
   print("")
 end
 
@@ -1666,13 +1775,21 @@
     local engine
     for _,engine in pairs(engines) do
       local tlgengine = ((engine == stdengine and "") or "." .. engine)
-      local tlgfile = name .. tlgengine .. tlgext
-      local newfile = name .. "." .. engine .. logext
+      local tlgfile  = name .. tlgengine .. tlgext
+      local spdffile = name .. tlgengine .. pdfext
+      local newfile  = name .. "." .. engine .. logext
+      local pdffile  = name .. "." .. engine .. pdfext
+      local refext = ((optpdf and pdfext) or tlgext)
       if testexists(name) then
-        print("Creating and copying " .. tlgfile)
+        print("Creating and copying " .. refext)
         runtest(name, engine, false, lvtext)
-        ren(testdir, newfile, tlgfile)
-        cp(tlgfile, testdir, testfiledir)
+        if optpdf then
+          ren(testdir, pdffile, spdffile)
+          cp(spdffile, testdir, testfiledir)
+        else
+          ren(testdir, newfile, tlgfile)
+          cp(tlgfile, testdir, testfiledir)
+        end
         if fileexists(unpackdir .. "/" .. tlgfile) then
           print(
             "Saved " .. tlgext

Modified: trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex	2016-06-17 10:20:33 UTC (rev 41468)
+++ trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex	2016-06-17 15:17:17 UTC (rev 41469)
@@ -57,7 +57,6 @@
 \showboxdepth=\maxdimen
 \def\loggingoutput{\tracingoutput1
     \showboxbreadth\maxdimen\showboxdepth\maxdimen}
-
 \newlinechar=`\^^J
 \long\def\LONGTYPEOUT#1{%
   \begingroup
@@ -209,15 +208,43 @@
   \SEPARATOR
   \LONGTYPEOUT{}%
 }
-
 \def \TRUE  {\TYPE{TRUE}}
 \def \FALSE {\TYPE{FALSE}}
 \def \YES   {\TYPE{YES}}
 \def \NO    {\TYPE{NO}}
-
 \def \NEWLINE {\TYPE{^^J}}
+\ifnum 0%
+  \ifx\pdfoutput\@undefined\else\ifnum\pdfoutput>0 1\fi\fi
+  \ifx\outputmode\@undefined\else\ifnum\outputmode>0 1\fi\fi
+  >0 %
+  \ifx\pdfvariable\@undefined
+    \pdfinfo{/Producer (\ifx\directlua\@undefined pdf\else Lua\fi TeX)}
+    \ifx\pdfinfoomitdate\@undefined\else
+      \pdfinfoomitdate     = 1 %
+      \pdfsuppressptexinfo = 1 %
+      \pdftrailerid{}
+    \fi
+  \else
+    \pdfextension info{/Producer (LuaTeX)}
+    \pdfvariable suppressoptionalinfo \numexpr
+          0
+        +   1 % PTEX.Fullbanner
+        +  32 % CreationDate
+        +  64 % ModDate
+      \relax
+  \fi
+\else
+  \special{%
+    pdf: docinfo
+      <<
+        /Creator        (TeX)
+        /CreationDate   ()
+        /ModDate        ()
+        /Producer       (\ifx\XeTeXversion\@undefined\else x\fi dvipdfmx)
+      >>
+  }
+\fi
 \reset at catcodes
-
 %% 
 %%
 %% End of file `regression-test.tex'.



More information about the tex-live-commits mailing list