path: root/scripts
diff options
authorDiana Picus <diana.picus@linaro.org>2018-02-19 19:14:00 +0100
committerDiana Picus <diana.picus@linaro.org>2018-02-22 11:47:12 +0100
commitfec612c2a0bb8d1dd9c0a51a03c7b40caf66764e (patch)
tree8ef5099127a7812ab764f69c074a77cd3d1d2e9f /scripts
parent49ee93aa15132f4a90a98bca433678b622a5bdb2 (diff)
build-and-test: Allow flags to be read from files
Use the built-in support from the argparse module to allow our subcommand to read flags from configuration files. This is achieved by specifying a prefix (in our case '@') that indicates to argparse that it should read arguments from the file ('@filepath'), one per line. They are then processed as if they had been given on the command line in the position where the filename is. This makes it possible for flags in the file to override or be overriden by flags given on the command line, depending on their position relative to the filename. Flags that accumulate all the values that they receive cannot be overriden, but will instead accumulate everything regardless of whether it came from the command line or the file. Change-Id: I22a9a92a0f5ba49dd085ef5860c37bd4fc1009e1
Diffstat (limited to 'scripts')
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/llvm.py b/scripts/llvm.py
index 8d9a4c1..1962293 100644
--- a/scripts/llvm.py
+++ b/scripts/llvm.py
@@ -471,6 +471,7 @@ runTestSuite.set_defaults(run_command=run_the_test_suite)
buildAndTest = subcommands.add_parser(
'build-and-test', # TODO: This really needs a better name...
+ fromfile_prefix_chars='@',
help="Run complex build scenarios with one or two stages of clang and "
"optionally a test-suite run. This should be flexible enough to allow "
"us to reproduce any buildbot configuration, but it can obviously be "