[latex3-commits] [l3svn] 02/02: l3build: Add --testfiledir |-t option
noreply at latex-project.org
noreply at latex-project.org
Tue Jan 24 18:28:27 CET 2017
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit 26adbc6e3e37af2f7f0e4be641a94d7139b6b810
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Jan 24 16:50:40 2017 +0000
l3build: Add --testfiledir |-t option
Not yet finalised but working: allows a single alternative dir to
be selected.
---
l3build/l3build.lua | 60 ++++++++++++++++++++++++++++++++-------------------
1 file changed, 38 insertions(+), 22 deletions(-)
diff --git a/l3build/l3build.lua b/l3build/l3build.lua
index 1656620..8d71482 100644
--- a/l3build/l3build.lua
+++ b/l3build/l3build.lua
@@ -181,34 +181,37 @@ function argparse()
local files = { }
local long_options =
{
- date = "date" ,
- engine = "engine" ,
- ["halt-on-error"] = "halt" ,
- ["halt-on-failure"] = "halt" ,
- help = "help" ,
- pdf = "pdf" ,
- quiet = "quiet" ,
- release = "release"
+ date = "date" ,
+ engine = "engine" ,
+ ["halt-on-error"] = "halt" ,
+ ["halt-on-failure"] = "halt" ,
+ help = "help" ,
+ pdf = "pdf" ,
+ quiet = "quiet" ,
+ release = "release" ,
+ testfiledir = "testfiledir"
}
local short_options =
{
- d = "date" ,
- e = "engine" ,
- h = "help" ,
- H = "halt" ,
- p = "pdf" ,
- q = "quiet" ,
- r = "release"
+ d = "date" ,
+ e = "engine" ,
+ h = "help" ,
+ H = "halt" ,
+ p = "pdf" ,
+ q = "quiet" ,
+ r = "release" ,
+ t = "testfiledir"
}
local option_args =
{
- date = true ,
- engine = true ,
- halt = false,
- help = false,
- pdf = false,
- quiet = false,
- release = true
+ date = true ,
+ engine = true ,
+ halt = false,
+ help = false,
+ pdf = false,
+ quiet = false,
+ release = true,
+ testfiledir = 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
@@ -2148,5 +2151,18 @@ end
-- Allow main function to be disabled 'higher up'
main = main or stdmain
+-- Pick up and read any per-run testfiledir
+if userargs["testfiledir"] then
+ if #userargs["testfiledir"] == 1 then
+ testfiledir = userargs["testfiledir"][1]
+ if fileexists(testfiledir .. "/config.lua") then
+ dofile(testfiledir .. "/config.lua")
+ end
+ else
+ print("Cannot use more than one testfile dir at a time!")
+ return 1
+ end
+end
+
-- Call the main function
main(userargs["target"], userargs["files"])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list