diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-05 16:27:33 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-05 16:27:33 +0000 |
commit | 1891a167a13e424c5046b457f0ea68f88d890a7e (patch) | |
tree | 29593d6cfcbe458fd2b73eddff3012b3a767592c /llvm/utils/lit/lit.py | |
parent | 2dfdb820ca550f75769f6850bc27f825f1dce4f7 (diff) | |
download | bcm5719-llvm-1891a167a13e424c5046b457f0ea68f88d890a7e.tar.gz bcm5719-llvm-1891a167a13e424c5046b457f0ea68f88d890a7e.zip |
lit: Add --param NAME=VALUE option, for test suite specific use (to communicate
arbitrary command line arguments to the test suite).
llvm-svn: 86137
Diffstat (limited to 'llvm/utils/lit/lit.py')
-rwxr-xr-x | llvm/utils/lit/lit.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit.py b/llvm/utils/lit/lit.py index a856473c228..462f912e0b8 100755 --- a/llvm/utils/lit/lit.py +++ b/llvm/utils/lit/lit.py @@ -321,6 +321,10 @@ def main(): parser.add_option("", "--config-prefix", dest="configPrefix", metavar="NAME", help="Prefix for 'lit' config files", action="store", default=None) + parser.add_option("", "--param", dest="userParameters", + metavar="NAME=VAL", + help="Add 'NAME' = 'VAL' to the user defined parameters", + type=str, action="append", default=[]) group = OptionGroup(parser, "Output Format") # FIXME: I find these names very confusing, although I like the @@ -396,6 +400,15 @@ def main(): inputs = args + # Create the user defined parameters. + userParams = {} + for entry in opts.userParameters: + if '=' not in entry: + name,val = entry,'' + else: + name,val = entry.split('=', 1) + userParams[name] = val + # Create the global config object. litConfig = LitConfig.LitConfig(progname = os.path.basename(sys.argv[0]), path = opts.path, @@ -405,7 +418,8 @@ def main(): useTclAsSh = opts.useTclAsSh, noExecute = opts.noExecute, debug = opts.debug, - isWindows = (platform.system()=='Windows')) + isWindows = (platform.system()=='Windows'), + params = userParams) # Load the tests from the inputs. tests = [] |