texlive[41523] Master/texmf-dist: l3build (22jun16)
commits+karl at tug.org
commits+karl at tug.org
Wed Jun 22 23:30:19 CEST 2016
Revision: 41523
http://tug.org/svn/texlive?view=revision&revision=41523
Author: karl
Date: 2016-06-22 23:30:19 +0200 (Wed, 22 Jun 2016)
Log Message:
-----------
l3build (22jun16)
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-22 21:30:03 UTC (rev 41522)
+++ trunk/Master/texmf-dist/doc/latex/l3build/README.md 2016-06-22 21:30:19 UTC (rev 41523)
@@ -1,7 +1,7 @@
l3build: a testing and building system for LaTeX3
=================================================
-Release 2016/06/14 (r6608)
+Release 2016/06/22 (r6641)
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-22 21:30:03 UTC (rev 41522)
+++ trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx 2016-06-22 21:30:19 UTC (rev 41523)
@@ -39,8 +39,8 @@
\RequirePackage{expl3}
\def\ExplFileName{l3build}
\def\ExplFileDescription{L3 Regression test suite}
-\def\ExplFileDate{2016/06/14}
-\def\ExplFileVersion{6608}
+\def\ExplFileDate{2016/06/22}
+\def\ExplFileVersion{6641}
\documentclass[full]{l3doc}
\renewcommand\partname{Part}
\usepackage{multicol,needspace}
@@ -325,7 +325,7 @@
% \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
+% \item \texttt{--release} (\texttt{-r}) Release string to use when setting
% version data
% \end{itemize}
%
@@ -489,7 +489,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 |-v| command line options and if not
+% specified using the |-d| and |-r| 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}
@@ -1113,12 +1113,19 @@
% \subsection{Preliminaries}
%
% Unlike in the \LaTeXe{} regression test suite, reset catcodes: each test should set these
-% as appropriate.
+% as appropriate. There's also a quick test for Con\TeX{}t: it defines |\unprotect|
+% which should be a reasonable marker (and is needed as some catcodes are otherwise
+% wrong).
% \begin{macrocode}
-\expandafter\edef\csname reset\string @catcodes\endcsname{%
- \catcode`\noexpand\@=\the\catcode`\@\relax
-}
-\catcode`\@=11 %
+\ifx\unprotect\undefined
+ \expandafter\edef\csname reset\string @catcodes\endcsname{%
+ \catcode`\noexpand\@=\the\catcode`\@\relax
+ }
+ \catcode`\@=11 %
+\else
+ \unprotect
+ \def\reset at catcodes{\protect}%
+\fi
% \end{macrocode}
% Put \TeX{} into scroll mode, and stop it showing the
% implementation details of macros in error messages.
Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua 2016-06-22 21:30:03 UTC (rev 41522)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua 2016-06-22 21:30:19 UTC (rev 41523)
@@ -17,8 +17,8 @@
--]]
-- Version information: should be identical to that in l3build.dtx
-release_date = "2016/06/14"
-release_ver = "6608"
+release_date = "2016/06/22"
+release_ver = "6641"
-- "module" is a deprecated function in Lua 5.2: as we want the name
-- for other purposes, and it should eventually be 'free', simply
@@ -182,7 +182,7 @@
help = "help" ,
pdf = "pdf" ,
quiet = "quiet" ,
- version = "version"
+ release = "release"
}
local short_options =
{
@@ -192,7 +192,7 @@
H = "halt" ,
p = "pdf" ,
q = "quiet" ,
- v = "version"
+ r = "release"
}
local option_args =
{
@@ -202,7 +202,7 @@
help = false,
pdf = false,
quiet = false,
- version = true
+ release = true
}
-- arg[1] is a special case: must be a command or "-h"/"--help"
-- Deal with this by assuming help and storing only apparently-valid
@@ -312,7 +312,7 @@
opthelp = userargs["help"]
optpdf = userargs["pdf"]
optquiet = userargs["quiet"]
-optversion = userargs["version"]
+optrelease = userargs["release"]
-- Convert a file glob into a pattern for use by e.g. string.gub
-- Based on https://github.com/davidm/lua-glob-pattern
@@ -609,9 +609,9 @@
if optengines then
engines = " --engine=" .. table.concat(optengines, ",")
end
- local version = ""
- if optversion then
- version = " --version=" .. optversion[1]
+ local release = ""
+ if optrelease then
+ release = " --release=" .. release[1]
end
local errorlevel = run(
i,
@@ -621,7 +621,7 @@
.. engines
.. (optpdf and " -p" or "")
.. (optquiet and " -q" or "")
- .. version
+ .. release
)
if errorlevel ~= 0 then
return errorlevel
@@ -761,7 +761,7 @@
return false
end
-- Substitutions to remove some non-useful changes
- local function normalize(line)
+ local function normalize(line, lastline)
-- Zap line numbers from \show, \showbox, \box_show and the like:
-- do this before wrapping lines
line = string.gsub(line, "^l%.%d+ ", "l. ...")
@@ -769,8 +769,7 @@
-- Skip lines that have an explicit marker for truncation
if string.len(line) == maxprintline and
not string.match(line, "%.%.%.$") then
- lastline = (lastline or "") .. line
- return ""
+ return "", (lastline or "") .. line
end
local line = (lastline or "") .. line
lastline = ""
@@ -800,7 +799,7 @@
-- Merge all of .fd data into one line so will be removed later
if string.match(line, "^ *%([%.%/%w]+%.fd[^%)]*$") then
lastline = (lastline or "") .. line
- return ""
+ return "", (lastline or "") .. line
end
-- TeX90/XeTeX knows only the smaller set of dimension units
line = string.gsub(
@@ -819,6 +818,25 @@
end
-- Remove 'normal' direction information on boxes with (u)pTeX
line = string.gsub(line, ",? yoko direction,?", "")
+ -- Remove the \special line that in DVI mode keeps PDFs comparable
+ if string.match(line, "^%.*\\special%{pdf: docinfo << /Creator") then
+ return ""
+ end
+ -- Remove the \special line possibly present in DVI mode for paper size
+ if string.match(line, "^%.*\\special%{papersize") then
+ return ""
+ end
+ -- Remove ConTeXt stuff
+ if string.match(line, "^backend >") or
+ string.match(line, "^close source >") or
+ string.match(line, "^mkiv lua stats >") or
+ string.match(line, "^pages >") or
+ string.match(line, "^system >") or
+ string.match(line, "^used file >") or
+ string.match(line, "^used option >") or
+ string.match(line, "^used structure >") then
+ return ""
+ end
-- A tidy-up to keep LuaTeX and other engines in sync
local utf8_char = unicode.utf8.char
line = string.gsub(line, utf8_char(127), "^^?")
@@ -829,7 +847,7 @@
line = string.gsub(line, utf8_char(i), "^^" .. string.format("%02x", i))
end
end
- return line
+ return line, lastline
end
local lastline = ""
local newlog = ""
@@ -845,7 +863,7 @@
elseif string.match(line, "^%)?TIMO$") then
skipping = false
elseif not prestart and not skipping then
- line = normalize(line)
+ line, lastline = normalize(line, lastline)
if not string.match(line, "^ *$") and not killcheck(line) then
newlog = newlog .. line .. os_newline
end
@@ -1073,11 +1091,11 @@
if i == "luajitex" then
engine = "luatex"
end
- setup_check(name, engine)
- runtest(name, i, hide, lvtext)
- -- Generation of results heavily depends on test type
+ checkpdf = setup_check(name, engine)
+ runtest(name, i, hide, lvtext, checkpdf)
+ -- Generation of results depends on test type
local errlevel
- if optpdf then
+ if checkpdf then
errlevel = compare_pdf(name, engine)
else
errlevel = compare_tlg(name, engine)
@@ -1095,39 +1113,52 @@
function setup_check(name, engine)
local testname = name .. "." .. engine
- local refext = ((optpdf and pdfext) or tlgext)
- local reffile = locate(
+ local pdffile = locate(
{testfiledir, unpackdir},
- {testname .. refext, name .. refext}
+ {testname .. pdfext, name .. pdfext}
)
+ local tlgfile = locate(
+ {testfiledir, unpackdir},
+ {testname .. tlgext, name .. tlgext}
+ )
-- Attempt to generate missing reference file from expectation
- if not reffile then
+ if not (pdffile or tlgfile) then
if not locate({unpackdir, testfiledir}, {name .. lveext}) then
print(
- "Error: failed to find " .. refext .. " or "
+ "Error: failed to find " .. pdfext .. ", " .. tlgext .. " or "
.. lveext .. " file for " .. name .. "!"
)
os.exit(1)
end
- runtest(name, engine, hide, lveext)
- reffile = testdir .. "/" .. testname .. refext
- if not optpdf then
+ runtest(name, engine, true, lveext, true)
+ pdffile = testdir .. "/" .. testname .. pdfext
+ -- If a PDF is generated use it for comparisons
+ if not fileexists(pdffile) then
+ pdffile = nil
ren(testdir, testname .. logext, testname .. tlgext)
end
else
- cp(
- string.match(reffile, ".*/(.*)"),
- string.match(reffile, "(.*)/.*"),
- testdir
- )
+ -- Install comparison files found
+ for _,v in pairs({pdffile, tlgfile}) do
+ if v then
+ cp(
+ string.match(v, ".*/(.*)"),
+ string.match(v, "(.*)/.*"),
+ testdir
+ )
+ end
+ end
end
- if optpdf then
- local reffile = string.match(reffile, ".*/(.*)")
+ if pdffile then
+ local pdffile = string.match(pdffile, ".*/(.*)")
ren(
testdir,
- reffile,
- string.gsub(reffile, pdfext .. "$", ".ref" .. pdfext)
+ pdffile,
+ string.gsub(pdffile, pdfext .. "$", ".ref" .. pdfext)
)
+ return true
+ else
+ return false
end
end
@@ -1139,6 +1170,9 @@
local refpdffile = locate(
{testdir}, {testname .. ".ref" .. pdfext, name .. ".ref" .. pdfext}
)
+ if not refpdffile then
+ return
+ end
if os_windows then
refpdffile = unix_to_win(refpdffile)
end
@@ -1157,6 +1191,9 @@
local difffile = testdir .. "/" .. testname .. os_diffext
local logfile = testdir .. "/" .. testname .. logext
local tlgfile = locate({testdir}, {testname .. tlgext, name .. tlgext})
+ if not tlgfile then
+ return
+ end
if os_windows then
tlgfile = unix_to_win(tlgfile)
end
@@ -1187,7 +1224,7 @@
-- 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)
+function runtest(name, engine, hide, ext, makepdf)
local lvtfile = name .. (ext or lvtext)
cp(lvtfile, fileexists(testfiledir .. "/" .. lvtfile)
and testfiledir or unpackdir, testdir)
@@ -1216,9 +1253,21 @@
end
-- Special casing for XeTeX engine
local checkopts = checkopts
- if string.match(engine, "xetex") then
- if not optpdf then
- checkopts = checkopts .. " -no-pdf"
+ if string.match(engine, "xetex") and not makepdf then
+ checkopts = checkopts .. " -no-pdf"
+ end
+ -- Special casing for ConTeXt
+ if string.match(checkformat, "^context$") then
+ format = ""
+ if engine == "luatex" or engine == "luajittex" then
+ realengine = "context"
+ elseif engine == "pdftex" then
+ realengine = "texexec"
+ elseif engine == "xetex" then
+ realengine = "texexec --xetex"
+ else
+ print("Engine incompatible with format")
+ os.exit(1)
end
end
local logfile = testdir .. "/" .. name .. logext
@@ -1255,10 +1304,8 @@
runtest_tasks(stripext(lvtfile))
)
end
- if optpdf then
- if fileexists(testdir .. "/" .. name .. dviext) then
- dvitopdf(name, testdir, engine, hide)
- end
+ if makepdf and fileexists(testdir .. "/" .. name .. dviext) then
+ dvitopdf(name, testdir, engine, hide)
end
formatlog(logfile, newfile, engine)
-- Store secondary files for this engine
@@ -1468,7 +1515,7 @@
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(" --release|-r Sets the release to insert into sources")
print("")
print("See l3build.pdf for further details.")
end
@@ -1782,7 +1829,7 @@
local refext = ((optpdf and pdfext) or tlgext)
if testexists(name) then
print("Creating and copying " .. refext)
- runtest(name, engine, false, lvtext)
+ runtest(name, engine, false, lvtext, optpdf)
if optpdf then
ren(testdir, pdffile, spdffile)
cp(spdffile, testdir, testfiledir)
@@ -1814,7 +1861,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, version)
+ function setversion_update_line(line, date, release)
-- No real regex so do it one type at a time
for _,i in pairs({"Class", "File", "Package"}) do
if string.match(
@@ -1824,7 +1871,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 " .. version
+ line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. release
)
break
end
@@ -1832,7 +1879,7 @@
return line
end
elseif versionform == "ProvidesExplPackage" then
- function setversion_update_line(line, date, version)
+ function setversion_update_line(line, date, release)
-- No real regex so do it one type at a time
for _,i in pairs({"Class", "File", "Package"}) do
if string.match(
@@ -1842,7 +1889,7 @@
line = string.gsub(
line,
"{%d%d%d%d/%d%d/%d%d}( *){[^}]*}",
- "{" .. string.gsub(date, "%-", "/") .. "}%1{" .. version .. "}"
+ "{" .. string.gsub(date, "%-", "/") .. "}%1{" .. release .. "}"
)
break
end
@@ -1850,22 +1897,22 @@
return line
end
elseif versionform == "filename" then
- function setversion_update_line(line, date, version)
+ function setversion_update_line(line, date, release)
if string.match(line, "^\\def\\filedate{%d%d%d%d/%d%d/%d%d}$") then
line = "\\def\\filedate{" .. string.gsub(date, "%-", "/") .. "}"
end
if string.match(line, "^\\def\\fileversion{[^}]+}$") then
- line = "\\def\\fileversion{" .. version .. "}"
+ line = "\\def\\fileversion{" .. release .. "}"
end
return line
end
elseif versionform == "ExplFileName" then
- function setversion_update_line(line, date, version)
+ function setversion_update_line(line, date, release)
if string.match(line, "^\\def\\ExplFileDate{%d%d%d%d/%d%d/%d%d}$") then
line = "\\def\\ExplFileDate{" .. string.gsub(date, "%-", "/") .. "}"
end
if string.match(line, "^\\def\\ExplFileVersion{[^}]+}$") then
- line = "\\def\\ExplFileVersion{" .. version .. "}"
+ line = "\\def\\ExplFileVersion{" .. release .. "}"
end
return line
end
@@ -1873,7 +1920,7 @@
end
-- Used to actually carry out search-and-replace
-setversion_update_line = setversion_update_line or function(line, date, version)
+setversion_update_line = setversion_update_line or function(line, date, release)
return line
end
@@ -1910,13 +1957,13 @@
if optdate then
date = optdate[1] or date
end
- local version = -1
- if optversion then
- version = optversion[1] or version
+ local release = -1
+ if optrelease then
+ release = optrelease[1] or release
end
for _,i in pairs(versionfiles) do
for _,j in pairs(filelist(".", i)) do
- rewrite(j, date, version)
+ rewrite(j, date, release)
end
end
return 0
@@ -2050,7 +2097,7 @@
errorlevel = bundlectan()
elseif target == "doc" then
errorlevel = doc(files)
- elseif target == "check" and testfiledir ~= "" then
+ elseif target == "check" then
errorlevel = check(files)
elseif target == "clean" then
errorlevel = clean()
@@ -2060,7 +2107,7 @@
errorlevel = ctan(true)
elseif target == "install" then
errorlevel = install()
- elseif target == "save" and testfiledir ~= "" then
+ elseif target == "save" then
if next(files) then
errorlevel = save(files)
else
Modified: trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex 2016-06-22 21:30:03 UTC (rev 41522)
+++ trunk/Master/texmf-dist/tex/latex/l3build/regression-test.tex 2016-06-22 21:30:19 UTC (rev 41523)
@@ -47,10 +47,15 @@
%%
%% -----------------------------------------------------------------------
%%
-\expandafter\edef\csname reset\string @catcodes\endcsname{%
- \catcode`\noexpand\@=\the\catcode`\@\relax
-}
-\catcode`\@=11 %
+\ifx\unprotect\undefined
+ \expandafter\edef\csname reset\string @catcodes\endcsname{%
+ \catcode`\noexpand\@=\the\catcode`\@\relax
+ }
+ \catcode`\@=11 %
+\else
+ \unprotect
+ \def\reset at catcodes{\protect}%
+\fi
\scrollmode
\errorcontextlines=-1 %
\showboxbreadth=\maxdimen
More information about the tex-live-commits
mailing list