[latex3-commits] [l3svn] 07/07: l3build: Add a way to include 'secondary' tasks in tests

noreply at latex-project.org noreply at latex-project.org
Sun May 22 22:52:57 CEST 2016


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 1651dd719b39849297b3c05d5fa75168e60c2cda
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun May 22 21:04:38 2016 +0100

    l3build: Add a way to include 'secondary' tasks in tests
    
    This is primarily for bib latex, but others might also want it.
---
 l3build/l3build.dtx |   25 +++++++++++++++++++++++++
 l3build/l3build.lua |    6 ++++++
 2 files changed, 31 insertions(+)

diff --git a/l3build/l3build.dtx b/l3build/l3build.dtx
index 7482ecc..261c158 100644
--- a/l3build/l3build.dtx
+++ b/l3build/l3build.dtx
@@ -900,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}}
diff --git a/l3build/l3build.lua b/l3build/l3build.lua
index e0163fc..c5a4e7f 100644
--- a/l3build/l3build.lua
+++ b/l3build/l3build.lua
@@ -1237,6 +1237,8 @@ function runtest(name, engine, hide, ext)
       realengine ..  format .. " "
         .. checkopts .. " " .. asciiopt .. lvtfile
         .. (hide and (" > " .. os_null) or "")
+        .. os_concat ..
+      runtest_tasks(stripext(lvtfile)) 
     )
   end
   if optpdf then
@@ -1260,6 +1262,10 @@ function runtest(name, engine, hide, ext)
   end
 end
 
+-- A hook to allow additional tasks to run for the tests
+runtest_tasks = runtest_tasks or function(name)
+end
+
 function dvitopdf(name, dir, engine, hide)
   if string.match(engine, "^u?ptex$") then
     run(

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list