Author: jdevlieghere Date: Wed Jul 4 10:14:52 2018 New Revision: 336290 URL: http://llvm.org/viewvc/llvm-project?rev=336290&view=rev Log: [lit] Don't require semicolon separator
This patch removes the requirement for a semicolon as a separator when passing arguments to lit. It relies on the shlex module that is part of Python to do simple lexical analysis, similar to what happens in a Unix shell. Modified: lldb/trunk/lit/Suite/lit.cfg lldb/trunk/lit/Suite/lit.site.cfg.in Modified: lldb/trunk/lit/Suite/lit.cfg URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=336290&r1=336289&r2=336290&view=diff ============================================================================== --- lldb/trunk/lit/Suite/lit.cfg (original) +++ lldb/trunk/lit/Suite/lit.cfg Wed Jul 4 10:14:52 2018 @@ -3,6 +3,7 @@ # Configuration file for the 'lit' test runner. import os +import shlex import lit.formats @@ -14,13 +15,20 @@ config.suffixes = ['.py'] # test_source_root: The root path where tests are located. # test_exec_root: The root path where tests should be run. -config.test_source_root = os.path.join(config.lldb_src_root, 'packages','Python','lldbsuite','test') +config.test_source_root = os.path.join(config.lldb_src_root, 'packages', + 'Python', 'lldbsuite', 'test') config.test_exec_root = config.test_source_root # Build dotest command. dotest_cmd = [config.dotest_path, '-q'] dotest_cmd.extend(config.dotest_args_str.split(';')) +# We don't want to force users passing arguments to lit to use `;` as a +# separator. We use Python's simple lexical analyzer to turn the args into a +# list. +if config.dotest_lit_args_str: + dotest_cmd.extend(shlex.split(config.dotest_lit_args_str)) + # Load LLDB test format. sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite")) import lldbtest Modified: lldb/trunk/lit/Suite/lit.site.cfg.in URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.site.cfg.in?rev=336290&r1=336289&r2=336290&view=diff ============================================================================== --- lldb/trunk/lit/Suite/lit.site.cfg.in (original) +++ lldb/trunk/lit/Suite/lit.site.cfg.in Wed Jul 4 10:14:52 2018 @@ -14,14 +14,13 @@ config.python_executable = "@PYTHON_EXEC config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py" config.dotest_args_str = "@LLDB_DOTEST_ARGS@" config.lldb_disable_python = @LLDB_DISABLE_PYTHON@ - +config.dotest_lit_args_str = None # Additional dotest arguments can be passed to lit by providing a # semicolon-separates list: --param dotest-args="arg;arg". dotest_lit_args_str = lit_config.params.get('dotest-args', None) if dotest_lit_args_str: - config.dotest_args_str += ';' - config.dotest_args_str += dotest_lit_args_str + config.dotest_lit_args_str = dotest_lit_args_str # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time. _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits