texlive[44741] Master/texmf-dist: l3build (2jul17)

commits+karl at tug.org commits+karl at tug.org
Sun Jul 2 23:13:29 CEST 2017


Revision: 44741
          http://tug.org/svn/texlive?view=revision&revision=44741
Author:   karl
Date:     2017-07-02 23:13:29 +0200 (Sun, 02 Jul 2017)
Log Message:
-----------
l3build (2jul17)

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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/l3build/CONTRIBUTING.md

Added: trunk/Master/texmf-dist/doc/latex/l3build/CONTRIBUTING.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/l3build/CONTRIBUTING.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/l3build/CONTRIBUTING.md	2017-07-02 21:13:29 UTC (rev 44741)
@@ -0,0 +1,51 @@
+Thanks for considering contributing to `l3build`: feedback, fixes and ideas are
+all useful. Here, we ([The LaTeX3 Project](https://www.latex-project.org)) have
+collected together a few pointers to help things along.
+
+## Bugs
+
+Please log bugs using the [issues](https://github.com/latex3/l3build/issues)
+system on GitHub, and choose the 'bug' label. Handy information that you might
+include, depending on the nature of the issue, includes
+
+- Your version of `l3build` (`texlua l3build.lua version`)
+- Your TeX system details (for example 'TeX Live 2017')
+- Your operating system
+- The contents of your `build.lua` file
+- An 'ASCII art' explanation of your directory layout
+
+## Feature requests
+
+Feature requests are welcome: log them in the same way as bugs and pick
+the 'Enhancement' label. We welcome feature requests for the test set up,
+the build process, _etc._
+
+## Code contributions
+
+If you want to discuss a possible contribution before (or instead of)
+making a pull request, drop a line to
+[the team](mailto:latex-team at latex-project.org).
+
+There are a few things that might look non-standard to most Lua programmers,
+which come about as `l3build`'s focus is testing and building LaTeX packages:
+
+- Our target Lua set up is `texlua` (part of LuaTeX), not standalone `lua`
+- The main `l3build.lua` file is self-contained as this helps with
+  bootstrapping LaTeX: we are aiming to maintain a single file with
+  `.lua` dependencies
+- The primary documentation is aimed at the TeX world, so is in PDF format
+  and generated from `l3build.dtx`
+- As far as possible, everything is done within `l3build` itself or tools
+  directly available in a TeX system or as standard in the supported
+  systems (Windows, MacOS, Linux)
+- The `l3build` interfaces should be platform-agnostic (though it may be
+  necessary of course to branch inside particular functions)
+
+If you are submitting a pull request, notice that
+
+- We use Travis-CI for (light) testing so add `[ci skip]` to documentation-only
+  commit messages
+- We favour a single linear history so will rebase agreed pull requests on to
+  the `master` branch
+- Where a commit fixes or closes an issue, please include this information
+  in the first line of the commit message


Property changes on: trunk/Master/texmf-dist/doc/latex/l3build/CONTRIBUTING.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/l3build/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/l3build/README.md	2017-07-02 21:13:18 UTC (rev 44740)
+++ trunk/Master/texmf-dist/doc/latex/l3build/README.md	2017-07-02 21:13:29 UTC (rev 44741)
@@ -1,7 +1,7 @@
 l3build: a testing and building system for LaTeX3
 =================================================
 
-Release 2017/06/25
+Release 2017/07/01
 
 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	2017-07-02 21:13:18 UTC (rev 44740)
+++ trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx	2017-07-02 21:13:29 UTC (rev 44741)
@@ -16,7 +16,7 @@
 %
 % The development version of the bundle can be found at
 %
-%    https://github.com/latex3/latex3
+%    https://github.com/latex3/l3build
 %
 % for those people who are interested.
 %
@@ -98,7 +98,7 @@
 \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{lveext} {".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.}
@@ -108,7 +108,7 @@
 \luavarset{unpackdeps}  {\{~\}} {\dots for unpacking.}
 \luavarseparator
 \luavarset{checkengines}{\{"pdftex", "xetex", "luatex"\}} {Engines to check with \texttt{check} by default.}
-\luavarset{stdengine}    {"pdtex"} {Engine to generate \texttt{.tlg} file from.}
+\luavarset{stdengine}    {"pdftex"} {Engine to generate \texttt{.tlg} file from.}
 \luavarset{checkformat}  {"latex"} {Format to use for tests.}
 \luavarseparator
 \luavarset{typesetexe} {"pdflatex"} {Executable for compiling \texttt{doc(s)}.}
@@ -203,7 +203,7 @@
 %    }^^A
 % }
 %
-% \date{Released 2017/06/25}
+% \date{Released 2017/07/01}
 %
 % \maketitle
 % \tableofcontents
@@ -300,6 +300,9 @@
 %   data
 % \item \texttt{--engine} (\texttt{-e}) Sets the engine to use for
 %   testing
+% \item \texttt{--force} (\texttt{-f}) Force checks to run even if sanity
+%   checks fail, \emph{e.g.}~when \texttt{--engine} is not given in
+%   \luavar{checkengines}
 % \item \texttt{--halt-on-error} (\texttt{-H}) Specifies that checks
 %   should stop as soon as possible, rather than running all requested
 %   tests; the difference file is printed in the terminal directly in the case of failure
@@ -306,9 +309,9 @@
 % \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{--release} (\texttt{-r}) Release string to use when setting
+% \item \texttt{--textfiledir} (\texttt{-t}) Select a specific set of tests
+% \item \texttt{--version} (\texttt{-v}) Version string to use when setting
 %   version data
-% \item \texttt{--textfiledir} (\texttt{-t}) Select a specific set of tests
 % \end{itemize}
 %
 % \begin{buildcmd}{check}
@@ -352,7 +355,9 @@
 % Checks only the test \texttt{\meta{name(s)}.lvt}.
 % All engines specified by \var{checkengines} are tested unless the command
 % line option \texttt{--engine} (or \texttt{-e}) has been given to limit
-% testing to a single engine.
+% testing to a single engine. Normally testing is preceded by unpacking
+% source files and copying the result plus any additional support to the
+% test directory: this may be skipped using the \texttt{-s} option.
 % \end{buildcmd}
 %
 % \begin{buildcmd}{check -p}
@@ -443,7 +448,7 @@
 %
 % Source files specified in \var{sourcefiles} and \var{typesetsourcefiles}
 % are unpacked before the typesetting takes place. (In most cases
-% \var{typesetsourcefiles} will be mepty, but may be used where there are
+% \var{typesetsourcefiles} will be empty, but may be used where there are
 % files to unpack \emph{only} for typesetting.)
 %
 % If \var{typesetsearch} is \code{true} (default), standard \texttt{texmf} search trees are used in the typesetting compilation. If set to false, \emph{all} necessary files for compilation must be included in the |build/local| sandbox.
@@ -480,7 +485,7 @@
 % \begin{buildcmd}{setversion}
 % Modifies the content of files specified by |versionfiles| to allow
 % automatic updating of the file date and version. The latter are
-% specified using the |-d| and |-r| command line options and if not
+% specified using the |-d| and |-v| command line options and if not
 % given will default to the current date in ISO format (YYYY-MM-DD) and |-1|,
 % respectively. As detailed below, the standard set up has no search pattern
 % defined for this target and so no action will be taken \emph{unless}
@@ -776,6 +781,9 @@
 % \cs{TESTEXP} surrounds its contents with \cs{TYPE} and formatting to match \cs{TEST}; this can be used as a shorthand to test expandable commands.
 % \item
 % TODO: would a \cs{TESTFEXP} command (based on \cs{romannumeral} expansion) be useful as well?
+% \item
+% \cs{BEGINTEST}\marg{title} \dots \cs{ENDTEST} is an environment form of
+% \cs{TEST}, allowing verbatim material, \emph{etc.} to appear.
 % \end{itemize}
 % An example of some of these commands is shown following.
 % \begin{Verbatim}
@@ -917,6 +925,22 @@
 %   \label{fig:box-log}
 % \end{figure}
 %
+% \subsection{Testing entire pages}
+%
+% There may be occasions where creating entire test pages is necessary
+% to observe the test output required. That is best achieved by applying
+% \cs{showoutput} and forcing a complete page to be produced, for example
+% \begin{Verbatim}[frame=single,fontsize=\small]
+% \input{regression-test.tex}
+% \documentclass{article}
+% \usepackage{expl3}
+% \START
+% \showoutput
+% % Test content here
+% \vfil\break
+% \END
+% \end{Verbatim}
+%
 % \subsection{Additional test tasks}
 %
 % A standard test will run the file \texttt{\meta{name}.lvt} using one
@@ -1034,7 +1058,7 @@
 % a suitable function might read as shown in Figure~\ref{fig:update-line}.
 % \begin{figure}
 %   \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6]
-%     function setversion_update_line(line, date, release)
+%     function setversion_update_line(line, date, version)
 %       -- No real regex so do it one type at a time
 %       for _,i in pairs({"Class", "File", "Package"}) do
 %         if string.match(
@@ -1044,7 +1068,7 @@
 %           line = string.gsub(line, "%[%d%d%d%d/%d%d/%d%d", "["
 %             .. string.gsub(date, "%-", "/")
 %           line = string.gsub(
-%             line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. release
+%             line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. version
 %           )
 %           break
 %         end
@@ -1133,12 +1157,14 @@
 %       \var{date}        & String  \\
 %       \var{engine}      & Table   \\
 %       \var{files}       & Table   \\
+%       \var{force}       & Boolean \\
 %       \var{halt}        & Boolean \\
 %       \var{help}        & Boolean \\
 %       \var{pdf}         & Boolean \\
 %       \var{quiet}       & Boolean \\
-%       \var{release}     & String  \\
+%       \var{rerun}       & Boolean \\
 %       \var{testfiledir} & String  \\
+%       \var{version}     & String  \\
 %     \bottomrule
 %     \end{tabular}
 %   \end{center}
@@ -1256,7 +1282,7 @@
 %   error level.
 % \end{function}
 %
-% \begin{function}{spltpath()}
+% \begin{function}{splitpath()}
 %   \begin{syntax}
 %     |splitpath(|\meta{file}|)|
 %   \end{syntax}
@@ -1290,7 +1316,7 @@
 %
 % \begin{variable}{os_null}
 %   The location to redirect commands which should produce no output
-%   at the terminal: almost always used preded by |>|, \emph{e.g.}
+%   at the terminal: almost always used preceded by |>|, \emph{e.g.}
 %   \begin{verbatim}
 %     os.execute("tex " .. file .. " > " .. os_null)
 %   \end{verbatim}
@@ -1317,6 +1343,17 @@
 %   used inside |os.execute| (it does not terminate).
 % \end{variable}
 %
+% \subsection{Components of \texttt{l3build}}
+%
+% \begin{function}{call()}
+%   \begin{syntax}
+%     |call(|\meta{dirs}, \meta{target}|)|
+%   \end{syntax}
+%   Runs the \texttt{l3build} \meta{target} (a string) for each directory in the
+%   \meta{dirs} (a table). This will pass command line options for the parent
+%   script to the child processes.
+% \end{function}
+%
 % \end{documentation}
 %
 % \begin{implementation}
@@ -1492,7 +1529,18 @@
 % \end{macro}
 %
 % \begin{macro}
-%   {\SEPARATOR, \TEST, \TESTEXP, \TRUE, \FALSE, \YES, \NO, \NEWLINE}
+%   {
+%     \SEPARATOR,
+%     \BEGINTEST,
+%     \ENDTEST,
+%     \TEST,
+%     \TESTEXP,
+%     \TRUE,
+%     \FALSE,
+%     \YES,
+%     \NO,
+%     \NEWLINE
+%   }
 %   We are not starved for space in the log file output, so let's make it as
 %   verbose as is useful when reading the |.diff|'s.
 %    \begin{macrocode}
@@ -1501,7 +1549,7 @@
     ============================================================%
   }%
 }
-\long\def\TEST#1#2{%
+\protected\long\def\BEGINTEST#1{%
   \global\advance\gTESTint by 1 %
   \SEPARATOR
   \LONGTYPEOUT{TEST \the\gTESTint: \detokenize{#1}}%
@@ -1508,23 +1556,22 @@
   \SEPARATOR
   \begingroup
     \let\TYPE\LONGTYPEOUT
-    #2%
+
+}
+\protected\long\def\ENDTEST{%
   \endgroup
   \SEPARATOR
   \LONGTYPEOUT{}%
 }
+\long\def\TEST#1#2{%
+  \BEGINTEST{#1}%
+  #2%
+  \ENDTEST
+}
 \long\def\TESTEXP#1#2{%
-  \global\advance\gTESTint by 1 %
-  \SEPARATOR
-  \LONGTYPEOUT{%
-    TEST \the\gTESTint: \detokenize{#1}}%
-  \SEPARATOR
-  \begingroup
-    \long\def\TYPE##1{##1}%
-    \LONGTYPEOUT{#2}%
-  \endgroup
-  \SEPARATOR
-  \LONGTYPEOUT{}%
+  \BEGINTEST{#1}%
+  \LONGTYPEOUT{#2}%
+  \ENDTEST
 }
 \def \TRUE  {\TYPE{TRUE}}
 \def \FALSE {\TYPE{FALSE}}

Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua	2017-07-02 21:13:18 UTC (rev 44740)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua	2017-07-02 21:13:29 UTC (rev 44741)
@@ -16,7 +16,7 @@
 
 The development version of the bundle can be found at
 
-   https://github.com/latex3/latex3
+   https://github.com/latex3/l3build
 
 for those people who are interested.
 
@@ -23,7 +23,7 @@
 --]]
 
 -- Version information
-release_date = "2017/06/25"
+release_date = "2017/07/01"
 
 -- "module" is a deprecated function in Lua 5.2: as we want the name
 -- for other purposes, and it should eventually be 'free', simply
@@ -40,9 +40,16 @@
 if module == "" and bundle == "" then
   if string.match(arg[0], "l3build%.lua$") then
     print(
-      "\n"
-        .. "Error: Call l3build using a configuration file, not directly.\n"
+      "\n" ..
+      "l3build: A testing and building system for LaTeX\n\n" ..
+      "Release " .. release_date
     )
+    if arg[1] and not string.match(arg[1], "version") then
+      print(
+        "\n"
+          .. "Error: Call l3build using a configuration file, not directly.\n"
+      )
+    end
   else
     print(
       "\n"
@@ -222,35 +229,41 @@
     {
       date                = "date"       ,
       engine              = "engine"     ,
+      force               = "force"      ,
       ["halt-on-error"]   = "halt"       ,
       ["halt-on-failure"] = "halt"       ,
       help                = "help"       ,
       pdf                 = "pdf"        ,
       quiet               = "quiet"      ,
-      release             = "release"    ,
-      testfiledir         = "testfiledir"
+      rerun               = "rerun"      ,
+      testfiledir         = "testfiledir",
+      version             = "version"
     }
   local short_options =
     {
       d = "date"       ,
       e = "engine"     ,
+      f = "force"      ,
       h = "help"       ,
       H = "halt"       ,
       p = "pdf"        ,
       q = "quiet"      ,
-      r = "release"    ,
-      t = "testfiledir"
+      r = "rerun"      ,
+      t = "testfiledir",
+      v = "version"
     }
   local option_args =
     {
       date        = true ,
       engine      = true ,
+      force       = false,
       halt        = false,
       help        = false,
       pdf         = false,
       quiet       = false,
-      release     = true,
-      testfiledir = true
+      rerun       = false,
+      testfiledir = true ,
+      version     = true
     }
   local args = args
   -- arg[1] is a special case: must be a command or "-h"/"--help"
@@ -357,11 +370,33 @@
 
 local optdate    = options["date"]
 local optengines = options["engine"]
+local optforce   = options["force"]
 local opthalt    = options["halt"]
 local optpdf     = options["pdf"]
 local optquiet   = options["quiet"]
-local optrelease = options["release"]
+local optrerun   = options["rerun"]
+local optversion = options["version"]
 
+-- Sanity check
+if optengines and not optforce then
+   -- Make a lookup table
+   local t = { }
+  for _, engine in pairs(checkengines) do
+    t[engine] = true
+  end
+  for _, engine in pairs(optengines) do
+    if not t[engine] then
+      print("\n! Error: Engine \"" .. engine .. "\" not set up for testing!")
+      print("\n  Valid values are:")
+      for _, engine in ipairs(checkengines) do
+        print("  - " .. engine)
+      end
+      print("")
+      exit(1)
+    end
+  end
+end
+
 -- Convert a file glob into a pattern for use by e.g. string.gub
 -- Based on https://github.com/davidm/lua-glob-pattern
 -- Simplified substantially: "[...]" syntax not supported as is not
@@ -673,20 +708,12 @@
 --
 
 -- Do some subtarget for all modules in a bundle
-local function allmodules(target)
-  local date = ""
-  if optdate then
-    date = " --date=" .. optdate[1]
+function call(dirs, target)
+  local s = ""
+  for i = 2, #arg do
+    s = s .. " " .. arg[i]
   end
-  local engines = ""
-  if optengines then
-    engines = " --engine=" .. concat(optengines, ",")
-  end
-  local release = ""
-  if optrelease then
-    release = " --release=" .. optrelease[1]
-  end
-  for _,i in ipairs(modules) do
+  for _,i in ipairs(dirs) do
     print(
       "Running script " .. scriptname .. " with target \"" .. target
         .. "\" for module "
@@ -694,13 +721,7 @@
     )
     local errorlevel = run(
       i,
-      "texlua " .. scriptname .. " " .. target
-        .. (opthalt and " -H" or "")
-        .. date
-        .. engines
-        .. (optpdf and " -p" or "")
-        .. (optquiet and " -q" or "")
-        .. release
+      "texlua " .. scriptname .. " " .. target .. s
     )
     if errorlevel ~= 0 then
       return errorlevel
@@ -1390,6 +1411,8 @@
         .. os_concat ..
       os_setenv .. " SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1"
         .. os_concat ..
+      os_setenv .. " FORCE_SOURCE_DATE=1"
+        .. os_concat ..
       -- Ensure lines are of a known length
       os_setenv .. " max_print_line=" .. maxprintline
         .. os_concat ..
@@ -1637,11 +1660,13 @@
   print("Valid options are:")
   print("   --date|-d           Sets the date to insert into sources")
   print("   --engine|-e         Sets the engine to use for running test")
+  print("   --force|-f          Force tests to run if engine is not set up")
   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("   --release|-r        Sets the release to insert into sources")
+  print("   --rerun|-r          Runs tests without any unpacking, etc.")
   print("   --testfiledir|-t    Selects the specified testfile location")
+  print("   --version|-v        Sets the version to insert into sources")
   print("")
   print("See l3build.pdf for further details.")
 end
@@ -1649,7 +1674,9 @@
 function check(names)
   local errorlevel = 0
   if testfiledir ~= "" and direxists(testfiledir) then
-    checkinit()
+    if not optrerun then
+      checkinit()
+    end
     local hide = true
     if names and next(names) then
       hide = false
@@ -1740,7 +1767,7 @@
 end
 
 function bundleclean()
-  local errorlevel = allmodules("clean")
+  local errorlevel = call(modules, "clean")
   for _,i in ipairs(cleanfiles) do
     errorlevel = rm(".", i) + errorlevel
   end
@@ -1824,7 +1851,7 @@
     errorlevel = check()
     bundle = module
   else
-    errorlevel = allmodules("bundlecheck")
+    errorlevel = call(modules, "bundlecheck")
   end
   if errorlevel == 0 then
     rmdir(ctandir)
@@ -1834,7 +1861,7 @@
     if standalone then
       errorlevel = bundlectan()
     else
-      errorlevel = allmodules("bundlectan")
+      errorlevel = call(modules, "bundlectan")
     end
   else
     print("\n====================")
@@ -1897,7 +1924,7 @@
     end
     -- For the purposes here, any typesetting demo files need to be
     -- part of the main typesetting list
-    local typesetfiles
+    local typesetfiles = typesetfiles
     for _,v in pairs(typesetdemofiles) do
       insert(typesetfiles, v)
     end
@@ -2025,7 +2052,7 @@
 -- Provide some standard search-and-replace functions
 if versionform ~= "" and not setversion_update_line then
   if versionform == "ProvidesPackage" then
-    function setversion_update_line(line, date, release)
+    function setversion_update_line(line, date, version)
       -- No real regex so do it one type at a time
       for _,i in pairs({"Class", "File", "Package"}) do
         if match(
@@ -2035,7 +2062,7 @@
           line = gsub(line, "%[%d%d%d%d/%d%d/%d%d", "["
             .. gsub(date, "%-", "/"))
           line = gsub(
-            line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. release
+            line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. version
           )
           break
         end
@@ -2043,7 +2070,7 @@
       return line
     end
   elseif versionform == "ProvidesExplPackage" then
-    function setversion_update_line(line, date, release)
+    function setversion_update_line(line, date, version)
       -- No real regex so do it one type at a time
       for _,i in pairs({"Class", "File", "Package"}) do
         if match(
@@ -2053,7 +2080,7 @@
           line = gsub(
             line,
             "{%d%d%d%d/%d%d/%d%d}( *){[^}]*}",
-            "{" .. gsub(date, "%-", "/") .. "}%1{" .. release .. "}"
+            "{" .. gsub(date, "%-", "/") .. "}%1{" .. version .. "}"
           )
           break
         end
@@ -2061,22 +2088,22 @@
       return line
     end
   elseif versionform == "filename" then
-    function setversion_update_line(line, date, release)
+    function setversion_update_line(line, date, version)
       if match(line, "^\\def\\filedate{%d%d%d%d/%d%d/%d%d}$") then
         line = "\\def\\filedate{" .. gsub(date, "%-", "/") .. "}"
       end
       if match(line, "^\\def\\fileversion{[^}]+}$") then
-        line = "\\def\\fileversion{" .. release .. "}"
+        line = "\\def\\fileversion{" .. version .. "}"
       end
       return line
     end
   elseif versionform == "ExplFileDate" then
-    function setversion_update_line(line, date, release)
+    function setversion_update_line(line, date, version)
       if match(line, "^\\def\\ExplFileDate{%d%d%d%d/%d%d/%d%d}$") then
         line = "\\def\\ExplFileDate{" .. gsub(date, "%-", "/") .. "}"
       end
       if match(line, "^\\def\\ExplFileVersion{[^}]+}$") then
-        line = "\\def\\ExplFileVersion{" .. release .. "}"
+        line = "\\def\\ExplFileVersion{" .. version .. "}"
       end
       return line
     end
@@ -2084,16 +2111,16 @@
 end
 
 -- Used to actually carry out search-and-replace
-setversion_update_line = setversion_update_line or function(line, date, release)
+setversion_update_line = setversion_update_line or function(line, date, version)
   return line
 end
 
 function setversion(dir)
-  local function rewrite(dir, file, date, release)
+  local function rewrite(dir, file, date, version)
     local changed = false
     local result = ""
     for line in lines(dir .. "/" .. file) do
-      local newline = setversion_update_line(line, date, release)
+      local newline = setversion_update_line(line, date, version)
       if newline ~= line then
         line = newline
         changed = true
@@ -2121,14 +2148,14 @@
   if optdate then
     date = optdate[1] or date
   end
-  local release = -1
-  if optrelease then
-    release = optrelease[1] or release
+  local version = -1
+  if optversion then
+    version = optversion[1] or version
   end
   local dir = dir or "."
   for _,i in pairs(versionfiles) do
     for _,j in pairs(filelist(dir, i)) do
-      rewrite(dir, j, date, release)
+      rewrite(dir, j, date, version)
     end
   end
   return 0
@@ -2210,8 +2237,9 @@
 
 function version()
   print(
-    "\n"
-    .. "l3build Release " .. gsub(release_date, "/", "-") .. "\n"
+    "\n" ..
+    "l3build: A testing and building system for LaTeX\n\n" ..
+    "Release " .. release_date
   )
 end
 
@@ -2227,9 +2255,9 @@
     -- Detect all of the modules
     modules = modules or listmodules()
     if target == "doc" then
-      errorlevel = allmodules("doc")
+      errorlevel = call(modules, "doc")
     elseif target == "check" then
-      errorlevel = allmodules("bundlecheck")
+      errorlevel = call(modules, "bundlecheck")
       if errorlevel ~=0 then
         print("There were errors: checks halted!\n")
       end
@@ -2236,19 +2264,19 @@
     elseif target == "clean" then
       errorlevel = bundleclean()
     elseif target == "cmdcheck" and next(cmdchkfiles) ~= nil then
-      errorlevel = allmodules("cmdcheck")
+      errorlevel = call(modules, "cmdcheck")
     elseif target == "ctan" then
       errorlevel = ctan()
     elseif target == "install" then
-      errorlevel = allmodules("install")
+      errorlevel = call(modules, "install")
     elseif target == "setversion" then
-      errorlevel = allmodules("setversion")
+      errorlevel = call(modules, "setversion")
       -- Deal with any files in the bundle dir itself
       if errorlevel == 0 then
         errorlevel = setversion()
       end
     elseif target == "unpack" then
-      errorlevel = allmodules("bundleunpack")
+      errorlevel = call(modules, "bundleunpack")
     elseif target == "version" then
       version()
     else

Modified: trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex	2017-07-02 21:13:18 UTC (rev 44740)
+++ trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex	2017-07-02 21:13:29 UTC (rev 44741)
@@ -101,7 +101,7 @@
     ============================================================%
   }%
 }
-\long\def\TEST#1#2{%
+\protected\long\def\BEGINTEST#1{%
   \global\advance\gTESTint by 1 %
   \SEPARATOR
   \LONGTYPEOUT{TEST \the\gTESTint: \detokenize{#1}}%
@@ -108,23 +108,22 @@
   \SEPARATOR
   \begingroup
     \let\TYPE\LONGTYPEOUT
-    #2%
+
+}
+\protected\long\def\ENDTEST{%
   \endgroup
   \SEPARATOR
   \LONGTYPEOUT{}%
 }
+\long\def\TEST#1#2{%
+  \BEGINTEST{#1}%
+  #2%
+  \ENDTEST
+}
 \long\def\TESTEXP#1#2{%
-  \global\advance\gTESTint by 1 %
-  \SEPARATOR
-  \LONGTYPEOUT{%
-    TEST \the\gTESTint: \detokenize{#1}}%
-  \SEPARATOR
-  \begingroup
-    \long\def\TYPE##1{##1}%
-    \LONGTYPEOUT{#2}%
-  \endgroup
-  \SEPARATOR
-  \LONGTYPEOUT{}%
+  \BEGINTEST{#1}%
+  \LONGTYPEOUT{#2}%
+  \ENDTEST
 }
 \def \TRUE  {\TYPE{TRUE}}
 \def \FALSE {\TYPE{FALSE}}



More information about the tex-live-commits mailing list