Index: docs/CommandGuide/lit.rst =================================================================== --- docs/CommandGuide/lit.rst +++ docs/CommandGuide/lit.rst @@ -122,6 +122,12 @@ suite take the most time to execute. Note that this option is most useful with ``-j 1``. +.. option:: --exec-feature=FEATURE + + Specify an additional feature of test execution that can be matched in REQUIRES + and XFAIL lines. For example, if you run tests under AddressSanitizer, you can + specify ``--exec-feature=asan``. + .. _selection-options: SELECTION OPTIONS Index: utils/lit/lit/LitConfig.py =================================================================== --- utils/lit/lit/LitConfig.py +++ utils/lit/lit/LitConfig.py @@ -19,7 +19,7 @@ def __init__(self, progname, path, quiet, useValgrind, valgrindLeakCheck, valgrindArgs, - noExecute, ignoreStdErr, debug, isWindows, + noExecute, execFeatures, ignoreStdErr, debug, isWindows, params, config_prefix = None): # The name of the test runner. self.progname = progname @@ -30,6 +30,7 @@ self.valgrindLeakCheck = bool(valgrindLeakCheck) self.valgrindUserArgs = list(valgrindArgs) self.noExecute = noExecute + self.execFeatures = list(execFeatures) self.ignoreStdErr = ignoreStdErr self.debug = debug self.isWindows = bool(isWindows) @@ -47,10 +48,12 @@ self.valgrindArgs = [] if self.useValgrind: + self.execFeatures.append('valgrind') self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no', '--tool=memcheck', '--trace-children=yes', '--error-exitcode=123'] if self.valgrindLeakCheck: + self.execFeatures.append('vg_leak') self.valgrindArgs.append('--leak-check=full') else: # The default is 'summary'. Index: utils/lit/lit/TestingConfig.py =================================================================== --- utils/lit/lit/TestingConfig.py +++ utils/lit/lit/TestingConfig.py @@ -29,13 +29,6 @@ 'TMP' : os.environ.get('TMP',''), }) - # Set the default available features based on the LitConfig. - available_features = [] - if litConfig.useValgrind: - available_features.append('valgrind') - if litConfig.valgrindLeakCheck: - available_features.append('vg_leak') - config = TestingConfig(parent, name = '', suffixes = set(), @@ -47,7 +40,7 @@ test_exec_root = None, test_source_root = None, excludes = [], - available_features = available_features) + available_features = litConfig.execFeatures) if os.path.exists(path): # FIXME: Improve detection and error reporting of errors in the Index: utils/lit/lit/discovery.py =================================================================== --- utils/lit/lit/discovery.py +++ utils/lit/lit/discovery.py @@ -222,6 +222,7 @@ valgrindLeakCheck = False, valgrindArgs = [], noExecute = False, + execFeatures = [], ignoreStdErr = False, debug = False, isWindows = (platform.system()=='Windows'), Index: utils/lit/lit/main.py =================================================================== --- utils/lit/lit/main.py +++ utils/lit/lit/main.py @@ -207,6 +207,10 @@ group.add_option("", "--no-execute", dest="noExecute", help="Don't execute any tests (assume PASS)", action="store_true", default=False) + group.add_option("", "--exec-feature", dest="execFeatures", + metavar="FEATURE", + help="Add user-defined feature of test execution", + type=str, action="append", default=[]) parser.add_option_group(group) group = OptionGroup(parser, "Test Selection") @@ -271,6 +275,7 @@ valgrindLeakCheck = opts.valgrindLeakCheck, valgrindArgs = opts.valgrindArgs, noExecute = opts.noExecute, + execFeatures = opts.execFeatures, ignoreStdErr = False, debug = opts.debug, isWindows = (platform.system()=='Windows'),