summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-08-26 17:33:09 +0000
committerKarl Berry <karl@freefriends.org>2014-08-26 17:33:09 +0000
commit6c4cd2ab2f8d1ebe3a051d700c3005d73eefe04c (patch)
tree16833d474c6532347c42dee6b34fa77aed22eca6 /Master/texmf-dist/source/latex/l3build
parent097e7dc0afa442be238a967b292237470680626e (diff)
l3 (26aug14)
git-svn-id: svn://tug.org/texlive/trunk@35045 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3build')
-rw-r--r--Master/texmf-dist/source/latex/l3build/l3build.dtx26
-rw-r--r--Master/texmf-dist/source/latex/l3build/l3build.lua128
2 files changed, 100 insertions, 54 deletions
diff --git a/Master/texmf-dist/source/latex/l3build/l3build.dtx b/Master/texmf-dist/source/latex/l3build/l3build.dtx
index c24304f0f68..615aabb1db5 100644
--- a/Master/texmf-dist/source/latex/l3build/l3build.dtx
+++ b/Master/texmf-dist/source/latex/l3build/l3build.dtx
@@ -39,8 +39,8 @@
\RequirePackage{expl3}
\def\ExplFileName{l3build}
\def\ExplFileDescription{L3 Regression test suite}
-\def\ExplFileDate{2014/07/19}
-\def\ExplFileVersion{5240}
+\def\ExplFileDate{2014/08/25}
+\def\ExplFileVersion{5378}
\documentclass[full]{l3doc}
\renewcommand\partname{Part}
\usepackage{multicol,needspace}
@@ -80,7 +80,7 @@
\luavarset{maindir} {"."}{The top level directory for this module or bundle.}
\luavarset{supportdir} {maindir .. "/support"} {Where copies of files to support check/doc compilation are stored.}
\luavarset{testfiledir} {maindir .. "/testfiles"} {Where the tests are.}
-\luavarset{testsupdir} {testfiledir .. "/support"} {Where support files for the tests are.}
+\luavarset{testsuppdir} {testfiledir .. "/support"} {Where support files for the tests are.}
\luavarseparator
\luavarset{localdir} {maindir .. "/build/local"} {Generated folder where support files are placed to allow \enquote{sandboxed} \TeX{} runs.}
\luavarset{testdir} {maindir .. "/build/test"} {Generated folder where tests are run.}
@@ -115,7 +115,7 @@
\luavarset{typesetdeps} {\{~\}} {\dots for typesetting docs.}
\luavarset{unpackdeps} {\{~\}} {\dots for unpacking.}
\luavarseparator
-\luavarset{checkengines}{\{"pdftex", "xetex", "luatex"\}} {Engines to check with \texttt{checklvt} by default.}
+\luavarset{checkengines}{\{"pdftex", "xetex", "luatex"\}} {Engines to check with \texttt{check} by default.}
\luavarset{stdengine} {"pdtex"} {Engine to generate \texttt{.tlg} file from.}
\luavarset{checkformat} {"latex"} {Format to use for tests.}
\luavarseparator
@@ -274,12 +274,12 @@
% In the working directory of a bundle or module, the following commands can be executed:
% \begin{itemize}[noitemsep]\ttfamily
% \item check
-% \item checklvt \meta{name} [\meta{engine}]
+% \item check \meta{name} [\meta{engine}]
% \item cmdcheck
% \item clean
% \item doc
% \item install
-% \item savetlg \meta{name} [\meta{engine}]
+% \item save \meta{name} [\meta{engine}]
% \item unpack
% \end{itemize}
% These commands are described below.
@@ -295,7 +295,7 @@
% \begin{itemize}
% \item all \var{installfiles} after unpacking;
% \item all \var{checkfiles} after unpacking;
-% \item any files in the directory \var{testsupdir};
+% \item any files in the directory \var{testsuppdir};
% \item any files that match \var{checksuppfiles} in the \var{supportdir}.
% \end{itemize}
% This range of possibilities allow sensible defaults but significant flexibility for defining your own test setups.
@@ -305,14 +305,14 @@
% The format used for tests can be altered by setting \var{checkformat}: the default setting \texttt{latex} means that tests are run using \emph{e.g.}~\texttt{pdflatex}, whereas setting to \texttt{plain} will run tests using \emph{e.g.}~\texttt{pdftex}.
% (Currently, this should be one of \texttt{latex} or \texttt{plain}.)
% To perform the check, the engine typesets each test \var{checkruns} times.
-% More detail on this in the documentation on |savetlg|.
+% More detail on this in the documentation on |save|.
% Options passed to the binary are defined in the variable \var{checkopts}.
%
% By default, |texmf| trees are searched for input files when checking. This can be disabled by setting \var{checksearch} to |false|: isolation provides confidence that the tests cannot accidentally be running with incorrect files installed in the main distribution or |hometexmf|.
% \end{buildcmd}
%
%
-% \begin{buildcmd}{checklvt \meta{name} [\meta{engine}]}
+% \begin{buildcmd}{check \meta{name} [\meta{engine}]}
% Checks only the test \texttt{\meta{name}.lvt} with optionally specified \meta{engine} (one of |pdftex|, |xetex|, or |luatex|).
% If an \meta{engine} is not specified, all three engines are checked (or those defined by the |checkengines| variable if changed from the default).
% \end{buildcmd}
@@ -392,8 +392,8 @@
% \end{buildcmd}
%
%
-% \begin{buildcmd}{savetlg \meta{name} [\meta{engine}]}
-% This command runs through the same execution as |checklvt| for a specific test \texttt{\meta{name}.lvt} with optional \texttt{\meta{engine}}.
+% \begin{buildcmd}{save \meta{name} [\meta{engine}]}
+% This command runs through the same execution as |check| for a specific test \texttt{\meta{name}.lvt} with optional \texttt{\meta{engine}}.
% If no \meta{engine} is specific, this command saves the output of the test to a |.tlg| file.
% This file is then used in all subsequent checks against the \texttt{\meta{name}.lvt} test.
%
@@ -596,7 +596,7 @@
% Additional customisations to this driver can be included in a local |regression-test.cfg| file, which will be loaded automatically if found.
%
% The macros loaded by |regression-test.tex| set up the test system and provide a number of commands to aid the production of a structured test suite.
-% The basis of the test suite is to output material into the |.log| file, from which a normalised test output (|.tlg|) file is produced by the build command |savetlg|.
+% The basis of the test suite is to output material into the |.log| file, from which a normalised test output (|.tlg|) file is produced by the build command |save|.
% A number of commands are provided for this; they are all written in uppercase to help avoid possible conflicts with other package commands.
%
% \subsection{Metadata and structural commands}
@@ -609,7 +609,7 @@
% The desired format can be indicated with \cs{FORMAT}\marg{format name}, and any packages or classes loaded can be indicated with
%
% \noindent\hspace*{2\parindent} \cs{CLASS}\oarg{options}\marg{class name, version}\par
-% \noindent\hspace*{2\parindent} \cs{PACKAGE}\oarg{options}\marg{class name, version}
+% \noindent\hspace*{2\parindent} \cs{PACKAGE}\oarg{options}\marg{package name, version}
%
% \noindent These do not provide information that is useful for automated checking; after all, packages change their version numbers frequently.
% Rather, including this information in a test indicates the conditions under which the test was definitely known to pass at a certain time in the past.
diff --git a/Master/texmf-dist/source/latex/l3build/l3build.lua b/Master/texmf-dist/source/latex/l3build/l3build.lua
index 02a6f8c066c..9e6bd7d8c59 100644
--- a/Master/texmf-dist/source/latex/l3build/l3build.lua
+++ b/Master/texmf-dist/source/latex/l3build/l3build.lua
@@ -17,20 +17,43 @@
--]]
-- Version information: should be identical to that in l3build.dtx
-release_date = "2014/07/19"
-release_ver = "5240"
+release_date = "2014/08/25"
+release_ver = "5378"
+
+-- "module" is a deprecated function in Lua 5.2: as we want the name
+-- for other purposes, and it should eventually be 'free', simply
+-- remove the built-in
+if type (module) == "function" then
+ module = nil
+end
-- Ensure the module and bundle exist
module = module or ""
bundle = bundle or ""
+-- Sanity check
+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"
+ )
+ else
+ print (
+ "\n" ..
+ "Error: Specify either bundle or module in configuration script.\n"
+ )
+ end
+ os.exit (1)
+end
+
-- Directory structure for the build system
-- Use Unix-style path separators
maindir = maindir or "."
-- Substructure for tests and support files
testfiledir = testfiledir or "testfiles" -- Set to "" to cancel any tests
-testsupdir = testsupdir or testfiledir .. "/support"
+testsuppdir = testsuppdir or testfiledir .. "/support"
supportdir = supportdir or maindir .. "/support"
-- Structure within a development area
@@ -64,7 +87,7 @@ cleanfiles = cleanfiles or {"*.pdf", "*.zip"}
excludefiles = excludefiles or {"*~"} -- Any Emacs stuff
installfiles = installfiles or {"*.sty"}
sourcefiles = sourcefiles or {"*.dtx", "*.ins"} -- Files to copy for unpacking
-txtfiles = txtfiles or {"*.markdown"}
+txtfiles = txtfiles or {"*.md", "*.markdown"}
typesetfiles = typesetfiles or {"*.dtx"}
typesetsuppfiles = typesetsuppfiles or { }
unpackfiles = unpackfiles or {"*.ins"} -- Files to actually unpack
@@ -378,9 +401,9 @@ function checkinit ()
for _,i in ipairs (checkfiles) do
cp (i, unpackdir, testdir)
end
- if direxists (testsupdir) then
- for _,i in ipairs (filelist (testsupdir)) do
- cp (i, testsupdir, testdir)
+ if direxists (testsuppdir) then
+ for _,i in ipairs (filelist (testsuppdir)) do
+ cp (i, testsuppdir, testdir)
end
end
for _,i in ipairs (checksuppfiles) do
@@ -441,6 +464,10 @@ function formatlog (logfile, newfile)
line = string.gsub (line, string.match (logfile, ".*/(.*)%" .. logext .. "$"), "")
-- Zap ./ at begin of filename
line = string.gsub (line, "%(%.%/", "(")
+ -- Zap paths if places other than 'here' are accessible
+ if checksearch then
+ line = string.gsub (line, "%(.*/([%w-]+%.[%w-]+)%s*$", "(../%1")
+ end
-- XeTeX knows only the smaller set of dimension units
line = string.gsub (
line, "cm, mm, dd, cc, bp, or sp", "cm, mm, dd, cc, nd, nc, bp, or sp"
@@ -463,6 +490,12 @@ function formatlog (logfile, newfile)
for i = 1, 31, 1 do
line = string.gsub (line, string.char (i), "^^" .. string.char (64 + i))
end
+ -- Minor LuaTeX difference: it does not include parentheses in one message
+ line = string.gsub (
+ line,
+ "%(If you're confused by all this, try typing `I}' now%.%)",
+ "If you're confused by all this, try typing `I}' now."
+ )
-- Minor LuaTeX bug: it prints an extra "'" in one message: add enough
-- context to hopefully hit only the bug
line = string.gsub (
@@ -524,6 +557,7 @@ function runcheck (name, engine, hide)
end
local errorlevel = 0
for _,i in ipairs (checkengines) do
+ cp (name .. tlgext, testfiledir, testdir)
runtest (name, i, hide)
local testname = name .. "." .. i
local difffile = testdir .. "/" .. testname .. os_diffext
@@ -593,30 +627,40 @@ end
help = help or function ()
print ""
if testfiledir ~= "" then
- print " build check - run automated check system "
+ print " build check - run all automated tests for all engines"
end
if module ~= "" and testfiledir ~= "" then
- print " build checklvt <name> - check one test file <name> for all engines"
- print " build checklvt <name> <engine> - check one test file <name> for <engine> "
+ print " build check <name> - check one test file <name> for all engines"
+ print " build check <name> <engine> - check one test file <name> for <engine> "
end
- print " build clean - clean out directory tree "
+ print " build clean - clean out directory tree "
if next (cmdchkfiles) ~= nil then
- print " build cmdcheck - check commands documented are defined "
+ print " build cmdcheck - check commands documented are defined "
end
if module == "" or bundle == "" then
- print " build ctan - create CTAN-ready archive "
+ print " build ctan - create CTAN-ready archive "
end
- print " build doc - runs all documentation files "
- print " build install - install files in local texmf tree "
+ print " build doc - runs all documentation files "
+ print " build install - install files in local texmf tree "
if module ~= "" and testfiledir ~= "" then
- print " build savetlg <name> - save test log for <name> for all engines "
- print " build savetlg <name> <engine> - save test log for <name> for <engine> "
+ print " build save <name> - save test log for <name> for all engines "
+ print " build save <name> <engine> - save test log for <name> for <engine> "
end
- print " build unpack - extract packages "
+ print " build unpack - extract packages "
print ""
end
-function check ()
+function check (name, engine)
+ local errorlevel = 0
+ if name then
+ errorlevel = checklvt (name, engine)
+ else
+ errorlevel = checkall ()
+ end
+ return (errorlevel)
+end
+
+function checkall ()
local errorlevel = 0
if testfiledir ~= "" and direxists (testfiledir) then
checkinit ()
@@ -630,11 +674,7 @@ function check ()
end
end
if errorlevel ~= 0 then
- print ("\n Check failed with difference files")
- for _,i in ipairs (filelist (testdir, "*" .. os_diffext)) do
- print (" - " .. testdir .. "/" .. i)
- end
- print ("")
+ checkdiff ()
else
print ("\n All checks passed\n")
end
@@ -643,23 +683,33 @@ function check ()
end
function checklvt (name, engine)
- local engine = engine or stdengine
if testexists (name) then
checkinit ()
print ("Running checks on " .. name)
- runcheck (name, engine)
- if fileexists (testdir .. "/" .. name .. "." .. engine .. os_diffext) then
- print (" Check fails with diff file")
- print (
- " " .. testdir .. "/" .. name .. "." .. engine .. os_diffext)
+ local errorlevel = runcheck (name, engine)
+ if errorlevel ~= 0 then
+ checkdiff ()
else
- print (" Check passes")
+ if engine then
+ print (" Check passes")
+ else
+ print ("\n All checks passed\n")
+ end
end
else
print ("Test \"" .. name .. "\" not set up!")
end
end
+-- A short auxiliary to print the list of differences for check
+function checkdiff ()
+ print ("\n Check failed with difference files")
+ for _,i in ipairs (filelist (testdir, "*" .. os_diffext)) do
+ print (" - " .. testdir .. "/" .. i)
+ end
+ print ("")
+end
+
-- Remove all generated files
function clean ()
-- To make sure that distribdir never contains any stray subdirs,
@@ -745,7 +795,9 @@ function ctan (standalone)
errorlevel = allmodules ("bundlecheck")
end
if errorlevel == 0 then
+ rmdir (ctandir)
mkdir (ctandir .. "/" .. bundle)
+ rmdir (tdsdir)
mkdir (tdsdir)
if standalone then
errorlevel = bundlectan ()
@@ -892,7 +944,7 @@ function install ()
end
end
-function savetlg (name, engine)
+function save (name, engine)
local tlgfile = name .. (engine and ("." .. engine) or "") .. tlgext
local newfile = name .. "." .. (engine or stdengine) .. logext
if fileexists (testfiledir .. "/" .. name .. lvtext) then
@@ -999,13 +1051,7 @@ function stdmain (target, file, engine)
elseif target == "doc" then
doc ()
elseif target == "check" and testfiledir ~= "" then
- check ()
- elseif target == "checklvt" and testfiledir ~= "" then
- if file then
- checklvt (file, engine)
- else
- help ()
- end
+ check (file, engine)
elseif target == "clean" then
clean ()
elseif target == "cmdcheck" and next (cmdchkfiles) ~= nil then
@@ -1014,9 +1060,9 @@ function stdmain (target, file, engine)
ctan (true)
elseif target == "install" then
install ()
- elseif target == "savetlg" and testfiledir ~= "" then
+ elseif target == "save" and testfiledir ~= "" then
if file then
- savetlg (file, engine)
+ save (file, engine)
else
help ()
end