Skip to content

Commit 2b67338

Browse files
committed
option to wildcard xfail-not
1 parent 78c460b commit 2b67338

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

llvm/docs/CommandGuide/lit.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,12 @@ The timing data is stored in the `test_exec_root` in a file named
350350

351351
Do not treat the specified tests as ``XFAIL``. The environment variable
352352
``LIT_XFAIL_NOT`` can also be used in place of this option. The syntax is the
353-
same as for :option:`--xfail` and ``LIT_XFAIL``. :option:`--xfail-not` and
354-
``LIT_XFAIL_NOT`` always override all other ``XFAIL`` specifications,
355-
including an :option:`--xfail` appearing later on the command line. The
356-
primary purpose is to suppress an ``XPASS`` result without modifying a test
357-
case that uses the ``XFAIL`` directive.
353+
same as for :option:`--xfail` and ``LIT_XFAIL`` except that ``LIST`` can be
354+
replaced with ``*`` to specify all tests marked as ``XFAIL``.
355+
:option:`--xfail-not` and ``LIT_XFAIL_NOT`` always override all other ``XFAIL``
356+
specifications, including an :option:`--xfail` appearing later on the command
357+
line. The primary purpose is to suppress an ``XPASS`` result without modifying
358+
a test case that uses the ``XFAIL`` directive.
358359

359360
.. option:: --num-shards M
360361

llvm/utils/lit/lit/cl_arguments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ def parse_args():
300300
"--xfail-not",
301301
metavar="LIST",
302302
type=_semicolon_list,
303-
help="do not XFAIL tests with paths in the semicolon separated list",
303+
help="do not XFAIL tests with paths in the semicolon separated list."
304+
" Can use * to apply to all such tests",
304305
default=os.environ.get("LIT_XFAIL_NOT", ""),
305306
)
306307
selection_group.add_argument(

llvm/utils/lit/lit/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ def mark_xfail(selected_tests, opts):
238238
test_full_name = t.getFullName()
239239
if test_file in opts.xfail or test_full_name in opts.xfail:
240240
t.xfails += "*"
241-
if test_file in opts.xfail_not or test_full_name in opts.xfail_not:
241+
if (
242+
test_file in opts.xfail_not
243+
or test_full_name in opts.xfail_not
244+
or opts.xfail_not == ["*"]
245+
):
242246
t.xfail_not = True
243247

244248

llvm/utils/lit/tests/xfail-cl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@
55
# RUN: %{inputs}/xfail-cl \
66
# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
77

8+
# RUN: %{lit} --xfail 'false.txt;false2.txt;top-level-suite :: b :: test.txt' \
9+
# RUN: --xfail-not '*' \
10+
# RUN: %{inputs}/xfail-cl \
11+
# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
12+
813
# RUN: env LIT_XFAIL='false.txt;false2.txt;top-level-suite :: b :: test.txt' \
914
# RUN: LIT_XFAIL_NOT='true-xfail.txt;top-level-suite :: a :: test-xfail.txt' \
1015
# RUN: %{lit} %{inputs}/xfail-cl \
1116
# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
1217

18+
# RUN: env LIT_XFAIL='false.txt;false2.txt;top-level-suite :: b :: test.txt' \
19+
# RUN: LIT_XFAIL_NOT='*' \
20+
# RUN: %{lit} %{inputs}/xfail-cl \
21+
# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
22+
1323
# Check that --xfail-not and LIT_XFAIL_NOT always have precedence.
1424

1525
# RUN: env LIT_XFAIL=true-xfail.txt \

0 commit comments

Comments
 (0)