From 3479a92321ed7fe7e2133d3daec2d4f5fd53fbc6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 2 Nov 2019 03:01:48 +0000 Subject: CTAN sync 201911020301 --- macros/latex/contrib/l3build/CHANGELOG.md | 21 ++- macros/latex/contrib/l3build/README.md | 2 +- macros/latex/contrib/l3build/l3build-check.lua | 27 ++-- macros/latex/contrib/l3build/l3build.1 | 2 +- macros/latex/contrib/l3build/l3build.dtx | 176 +++++++++++++++++-------- macros/latex/contrib/l3build/l3build.lua | 10 +- macros/latex/contrib/l3build/l3build.pdf | Bin 705508 -> 704268 bytes 7 files changed, 170 insertions(+), 68 deletions(-) (limited to 'macros/latex/contrib/l3build') diff --git a/macros/latex/contrib/l3build/CHANGELOG.md b/macros/latex/contrib/l3build/CHANGELOG.md index ec89a3f58a..b74e628687 100644 --- a/macros/latex/contrib/l3build/CHANGELOG.md +++ b/macros/latex/contrib/l3build/CHANGELOG.md @@ -7,6 +7,24 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2019-11-01] + +### Added + +- New `\ASSERT` and `\ASSERTSTR` functions (issue #102) + +### Changed + +- Avoid normalisation of (u)pTeX data when this is standard engine + (fixes #103) +- Normalise Lua data references (#107) +- Extend `runtest_task()` to pass run number +- Allow `regression-test` to load when e-TeX is unavailable (fixes #105) + +### Fixed + +- Location of `testsuppdir` when multiple configurations are used + ## [2019-10-02] ### Added @@ -370,7 +388,8 @@ this project uses date-based 'snapshot' version identifiers. - Rationalise short option names: removed `-d`, `-E`, `-r` - Target `cmdcheck`: specific to LaTeX3 kernel work -[Unreleased]: https://github.com/latex3/l3build/compare/2019-10-02...HEAD +[Unreleased]: https://github.com/latex3/l3build/compare/2019-11-01...HEAD +[2019-11-01]: https://github.com/latex3/l3build/compare/2019-10-02...2019-11-01 [2019-10-02]: https://github.com/latex3/l3build/compare/2019-09-30...2019-10-02 [2019-09-30]: https://github.com/latex3/l3build/compare/2019-09-29...2019-09-30 [2019-09-29]: https://github.com/latex3/l3build/compare/2019-09-28...2019-09-29 diff --git a/macros/latex/contrib/l3build/README.md b/macros/latex/contrib/l3build/README.md index 04fb613e32..d781a521d0 100644 --- a/macros/latex/contrib/l3build/README.md +++ b/macros/latex/contrib/l3build/README.md @@ -1,7 +1,7 @@ l3build: a testing and building system for LaTeX3 ================================================= -Release 2019-10-02 +Release 2019-11-01 Overview -------- diff --git a/macros/latex/contrib/l3build/l3build-check.lua b/macros/latex/contrib/l3build/l3build-check.lua index e2cdd655bf..ea550327eb 100644 --- a/macros/latex/contrib/l3build/l3build-check.lua +++ b/macros/latex/contrib/l3build/l3build-check.lua @@ -215,12 +215,14 @@ local function normalize_log(content,engine,errlevels) if match(line, "^> \\box%d+=$") or match(line, "^> \\box%d+=(void)$") then line = gsub(line, "%d+=", "...=") end - -- Remove 'normal' direction information on boxes with (u)pTeX - line = gsub(line, ",? yoko direction,?", "") - line = gsub(line, ",? yoko%(math%) direction,?", "") - -- Remove '\displace 0.0' lines in (u)pTeX - if match(line,"^%.*\\displace 0%.0$") then - return "" + if not match(stdengine,"^e?u?ptex$") then + -- Remove 'normal' direction information on boxes with (u)pTeX + line = gsub(line, ",? yoko direction,?", "") + line = gsub(line, ",? yoko%(math%) direction,?", "") + -- Remove '\displace 0.0' lines in (u)pTeX + if match(line,"^%.*\\displace 0%.0$") then + return "" + end end -- Remove the \special line that in DVI mode keeps PDFs comparable if match(line, "^%.*\\special%{pdf: docinfo << /Creator") then @@ -249,6 +251,9 @@ local function normalize_log(content,engine,errlevels) line = gsub(line, "save cache:", "load cache:") -- A tidy-up to keep LuaTeX and other engines in sync line = gsub(line, utf8_char(127), "^^?") + -- Remove lua data reference ids + line = gsub(line, "", + "") -- Unicode engines display chars in the upper half of the 8-bit range: -- tidy up to match pdfTeX if an ASCII engine is in use if next(asciiengines) then @@ -749,7 +754,7 @@ function runtest(name, engine, hide, ext, pdfmode, breakout) .. setup(lvtfile) .. (hide and (" > " .. os_null) or "") .. os_concat .. - runtest_tasks(jobname(lvtfile)) + runtest_tasks(jobname(lvtfile),i) ) -- Break the loop if the result is stable if breakout and i < checkruns then @@ -796,7 +801,7 @@ function runtest(name, engine, hide, ext, pdfmode, breakout) end -- A hook to allow additional tasks to run for the tests -runtest_tasks = runtest_tasks or function(name) +runtest_tasks = runtest_tasks or function(name,run) return "" end @@ -958,6 +963,10 @@ end function save(names) checkinit() local engines = options["engine"] or {stdengine} + if names == nil then + print("Arguments are required for the save command") + return 1 + end for _,name in pairs(names) do if testexists(name) then for _,engine in pairs(engines) do @@ -989,7 +998,7 @@ function save(names) .. lveext .. " file of the same name") return 1 else - print('Test "'.. name .. '"not found') + print('Test "' .. name .. '" not found') return 1 end end diff --git a/macros/latex/contrib/l3build/l3build.1 b/macros/latex/contrib/l3build/l3build.1 index 91374cd0fa..aa583fe599 100644 --- a/macros/latex/contrib/l3build/l3build.1 +++ b/macros/latex/contrib/l3build/l3build.1 @@ -1,4 +1,4 @@ -.TH l3build 1 "2019-10-02" +.TH l3build 1 "2019-11-01" .SH NAME l3build \- Checking and building packages .SH SYNOPSIS diff --git a/macros/latex/contrib/l3build/l3build.dtx b/macros/latex/contrib/l3build/l3build.dtx index e48fd8b195..2f55c5173d 100644 --- a/macros/latex/contrib/l3build/l3build.dtx +++ b/macros/latex/contrib/l3build/l3build.dtx @@ -231,7 +231,7 @@ % }^^A % } % -% \date{Released 2019-10-02} +% \date{Released 2019-11-01} % % \maketitle % \tableofcontents @@ -845,6 +845,9 @@ % \texttt{\cs{\meta{type}}\meta{...}} % \item Conversion of box numbers in |\show| lines % \texttt{>~\cs{box}\meta{number}=} to \texttt{>~\cs{box}...=} +% \item Conversion of Lua data reference ids +% \texttt{} to +% \texttt{} % \item Removal of some (u)p\TeX{} data where it is equivalent to % \pdfTeX{} (|yoko direction|, |\displace 0.0|) % \end{itemize} @@ -893,16 +896,6 @@ % % Any commands that write content to the |.log| file that should be ignored can be surrounded by |\OMIT| \dots\ |\TIMO|. % At the appropriate location in the document where the |.log| comparisons should start (say, after |\begin{document}|), the test suite must contain the |\START| macro. -% The test should then include \cs{AUTHOR}\marg{authors details} in case a test file fails in the future and needs to be re-analysed. -% -% Some additional diagnostic information can then be included as metadata for the conditions of the test. -% 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{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. % % The |\END| command signals the end of the test (but read on). % Some additional diagnostic information is printed at this time to debug if the test did not complete `properly' in terms of mismatched brace groups or \cs{if}\dots\cs{fi} groups. @@ -913,9 +906,6 @@ % % \subsection{Commands to help write tests} % -% A simple command \cs{CHECKCOMMAND}\cs{\meta{macro}} is provided to check whether a particular \cs{\meta{macro}} is defined, undefined, or equivalent to \cs{relax}. -% This is useful to flag either that internal macros are remaining local to their definitions, or that defined commands definitely are defined, or even as a reminder that commands you intend to define in a future package need to be tested once they appear. -% % \cs{TYPE} is used to write material to the \texttt{.log} file, like \LaTeX's \cs{typeout}, but it allows `long' input. % The following commands are defined to use \cs{TYPE} to output strings to the \texttt{.log} file. % \begin{itemize} @@ -936,6 +926,13 @@ % \item % \cs{BEGINTEST}\marg{title} \dots \cs{ENDTEST} is an environment form of % \cs{TEST}, allowing verbatim material, \emph{etc.} to appear. +% \item +% \cs{SHOWFILE} (\eTeX{} only) Shows the content of the file given as an +% argument. +% \item +% \cs{ASSERT} and \cs{ASSERTSTR} (\eTeX{} only) Asserts if the full expansion +% of the two required arguments are the same: the \cs{ASSERT} function is +% token-based, the \cs{ASSERTSTR} works on a string basis. % \end{itemize} % An example of some of these commands is shown following. % \begin{Verbatim} @@ -1105,19 +1102,23 @@ % 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 +% by defining |runtest_tasks|, a function taking two arguments, 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 +% \emph{i.e.}~it lacks an extension) and the current run number. +% The function |runtest_tasks| is run after the main call to the +% engine for a test cycle. It should return an errorlevel value. +% 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 +% function runtest_tasks(name,run) +% if run == 1 then +% return "biber " .. name +% else +% return 0 +% end % end % \end{lstlisting} % \caption{Example \texttt{runtest_tasks} function.} @@ -2028,12 +2029,11 @@ % % \subsection{Preliminaries} % -% We require \eTeX{}. +% We require \eTeX{} for some features. % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname eTeXversion\endcsname\relax - \errmessage{e-TeX is required to use regression-test.tex}% - \expandafter\endinput + \message{e-TeX is required by some regression-test.tex features}% \fi % \end{macrocode} % @@ -2058,7 +2058,11 @@ % Put \TeX{} into scroll mode, and stop it showing the % implementation details of macros in error messages. % \begin{macrocode} -\ifnum\interactionmode>1 \scrollmode\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname interactionmode\endcsname\relax +\else + \ifnum\interactionmode>1 \scrollmode\fi +\fi \errorcontextlines=-1 % % \end{macrocode} % @@ -2140,6 +2144,13 @@ \LONGTYPEOUT{^^JEND-TEST-LOG^^J}% \@@@end } +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname currentgrouplevel\endcsname\relax + \def\END{% + \LONGTYPEOUT{^^JEND-TEST-LOG^^J}% + \@@@end + } +\fi \ifx\@@end\@undefined \let\end\END \else @@ -2157,8 +2168,6 @@ % \end{macrocode} % \end{macro} % -% - % \begin{macro}{\SHOWFILE} % Load a file (e.g.,| \jobname.toc|) into the .log file with the usual special % characters rendered harmless. Use as |\SHOWFILE{\jobname.aux}|. @@ -2180,6 +2189,10 @@ \typeout{-------- #1 (end) -----------}% }% \endgroup +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname everyeof\endcsname\relax + \def\SHOWFILE#1{\TYPE{FEATURE UNAVAILABLE}} +\fi % \end{macrocode} % \end{macro} % @@ -2224,7 +2237,9 @@ % \FALSE, % \YES, % \NO, -% \NEWLINE +% \NEWLINE, +% \ASSERT, +% \ASSERTSTR % } % 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. @@ -2234,7 +2249,7 @@ ============================================================% }% } -\protected\long\def\BEGINTEST#1{% +\csname protected\endcsname\long\def\BEGINTEST#1{% \global\advance\gTESTint by 1 % \SEPARATOR \LONGTYPEOUT{TEST \the\gTESTint: \detokenize{#1}}% @@ -2242,7 +2257,21 @@ \begingroup \let\TYPE\LONGTYPEOUT } -\protected\long\def\ENDTEST{% +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname detokenize\endcsname\relax + \long\def\BEGINTEST#1{% + \global\advance\gTESTint by 1 % + \SEPARATOR + \begingroup + \toks0={#1}% + \LONGTYPEOUT{TEST \the\gTESTint: \the\toks0 }% + \endgroup + \SEPARATOR + \begingroup + \let\TYPE\LONGTYPEOUT + } +\fi +\csname protected\endcsname\long\def\ENDTEST{% \endgroup \SEPARATOR \LONGTYPEOUT{}% @@ -2262,11 +2291,74 @@ \def \YES {\TYPE{YES}} \def \NO {\TYPE{NO}} \def \NEWLINE {\TYPE{^^J}} +\csname protected\endcsname\long\def\ASSERT#1#2{% + \begingroup + \edef\@tempa{#1}% + \edef\@tempb{#2}% + \ifx\@tempa\@tempb + \TYPE{PASSED}% + \else + \TYPE{FAILED}% + \fi + \endgroup +} +\csname protected\endcsname\long\def\ASSERTSTR#1#2{% + \begingroup + \edef\@tempa{#1}% + \edef\@tempb{#2}% + \edef\@tempa{\detokenize\expandafter{\@tempa}}% + \edef\@tempb{\detokenize\expandafter{\@tempb}}% + \ifx\@tempa\@tempb + \TYPE{PASSED}% + \else + \TYPE{FAILED}% + \fi + \endgroup +} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname detokenize\endcsname\relax + \long\def\ASSERTSTR#1#2{% + \TYPE{FEATURE UNAVAILABLE}% + } +\fi % \end{macrocode} % \end{macro} % % \subsection{Suppressing variable data in output} % +% Disable compression in PDF output. +% \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 + \pdfcompresslevel=0 % + \pdfobjcompresslevel=0 % + \else + \pdfvariable compresslevel=0 % + \pdfvariable objcompresslevel=0 % + \fi +\else + \ifnum 0% + \ifx\XeTeXversion\@undefined\else 1\fi + \ifx\kanjiskip\@undefined\else 1\fi + >0 % + \special{dvipdfmx:config z 0}% Compress level + \special{dvipdfmx:config C 0x40}% Object compression + \fi +\fi +% \end{macrocode} +% +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname protected\endcsname\relax + \reset@catcodes + \let\protected\undefined + \expandafter\endinput +\fi +% \end{macrocode} +% % Load the map file early so it does not appear in the log. % \begin{macrocode} \ifx\pdfoutput\@undefined @@ -2335,30 +2427,6 @@ \fi % \end{macrocode} % -% Disable compression in PDF output. -% \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 - \pdfcompresslevel=0 % - \pdfobjcompresslevel=0 % - \else - \pdfvariable compresslevel=0 % - \pdfvariable objcompresslevel=0 % - \fi -\else - \ifnum 0% - \ifx\XeTeXversion\@undefined\else 1\fi - \ifx\kanjiskip\@undefined\else 1\fi - >0 % - \special{dvipdfmx:config z 0}% Compress level - \special{dvipdfmx:config C 0x40}% Object compression - \fi -\fi -% \end{macrocode} -% % Finish up. % \begin{macrocode} \reset@catcodes diff --git a/macros/latex/contrib/l3build/l3build.lua b/macros/latex/contrib/l3build/l3build.lua index d9f4fe23f8..48f3ab99d4 100755 --- a/macros/latex/contrib/l3build/l3build.lua +++ b/macros/latex/contrib/l3build/l3build.lua @@ -2,7 +2,7 @@ --[[ -File l3build.lua Copyright (C) 2014-2018 The LaTeX3 Project +File l3build.lua Copyright (C) 2014-2019 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -25,7 +25,7 @@ for those people who are interested. --]] -- Version information -release_date = "2019-10-02" +release_date = "2019-11-01" -- File operations are aided by the LuaFileSystem module local lfs = require("lfs") @@ -177,8 +177,14 @@ if #checkconfigs == 1 and (options["target"] == "check" or options["target"] == "save" or options["target"] == "clean") then local config = "./" .. gsub(checkconfigs[1],".lua$","") .. ".lua" if fileexists(config) then + local savedtestfiledir = testfiledir dofile(config) testdir = testdir .. "-" .. checkconfigs[1] + -- Reset testsuppdir if required + if savedtestfiledir ~= testfiledir and + testsuppdir == savedtestfiledir .. "/support" then + testsuppdir = testfiledir .. "/support" + end else print("Error: Cannot find configuration " .. checkconfigs[1]) exit(1) diff --git a/macros/latex/contrib/l3build/l3build.pdf b/macros/latex/contrib/l3build/l3build.pdf index 8a7d3fc1de..27c6e3c918 100644 Binary files a/macros/latex/contrib/l3build/l3build.pdf and b/macros/latex/contrib/l3build/l3build.pdf differ -- cgit v1.2.3