Skip to content

Commit 2b8a708

Browse files
authored
Add --filter and --filter-out arguments to test-suite (#18)
Sometimes it's useful to ignore a test you know is failing, or to only run a subset of tests that may reside in different directories. This adds flags for --filter and --filter-out which just get passed on to lit. --filter is kept alongside --only-test and --single-result in order to avoid interacting with diagnose and predication.
1 parent a9301a3 commit 2b8a708

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lnt/tests/test_suite.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,11 @@ def _lit(self, path, test, profile):
627627
'perf_profile_events=%s' %
628628
self.opts.perf_events]
629629

630+
if self.opts.filter:
631+
extra_args += ['--filter', self.opts.filter]
632+
if self.opts.filter_out:
633+
extra_args += ['--filter-out', self.opts.filter_out]
634+
630635
logger.info('Testing...')
631636
try:
632637
self._check_call([lit_cmd,
@@ -1088,6 +1093,12 @@ def diagnose(self):
10881093
@click.option("--only-test", "only_test", metavar="PATH",
10891094
type=click.UNPROCESSED, default=None,
10901095
help="Only run tests under PATH")
1096+
@click.option("--filter", metavar="REGEX",
1097+
help="Only run tests with paths matching the given regular "
1098+
"expression")
1099+
@click.option("--filter-out", metavar="REGEX",
1100+
help="Filter out tests with paths matching the given regular "
1101+
"expression")
10911102
# Test Execution
10921103
@click.option("--only-compile", "only_compile",
10931104
help="Don't run the tests, just compile them.", is_flag=True)

0 commit comments

Comments
 (0)