llvm-project/llvm/utils/lit/tests
Andrew Savonichev 1041a9642b [lit] Support %if ... %else syntax for RUN lines
This syntax allows to modify RUN lines based on features
available. For example:

    RUN: ... | FileCheck %s --check-prefix=%if windows %{CHECK-W%} %else %{CHECK-NON-W%}
    CHECK-W: ...
    CHECK-NON-W: ...

The whole command can be put under %if ... %else:

    RUN: %if tool_available %{ %tool %} %else %{ true %}

or:

    RUN: %if tool_available %{ %tool %}

If tool_available feature is missing, we'll have an empty command in
this RUN line.  LIT used to emit an error for empty commands, but now
it treats such commands as nop in all cases.

Multi-line expressions are also supported:

    RUN: %if tool_available %{ \
    RUN:   %tool               \
    RUN: %} %else %{           \
    RUN:   true                \
    RUN: %}

Background and motivation:
D121727 [NVPTX] Integrate ptxas to LIT tests
https://reviews.llvm.org/D121727

Differential Revision: https://reviews.llvm.org/D122569
2022-04-27 20:29:08 +03:00
..
Inputs [lit] Support %if ... %else syntax for RUN lines 2022-04-27 20:29:08 +03:00
unit [Reland][lit] Use sharding for GoogleTest format 2022-04-12 14:51:12 -07:00
.coveragerc
allow-retries.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
boolean-parsing.py
check-tested-lit-timeout-ability
custom-result-category.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
discovery.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
googletest-cmd-wrapper.py [Reland][lit] Use sharding for GoogleTest format 2022-04-12 14:51:12 -07:00
googletest-crash.py [lit] Keep stdout/stderr when using GoogleTest format 2022-04-25 12:26:03 -07:00
googletest-discovery-failed.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
googletest-format.py [lit] Keep stdout/stderr when using GoogleTest format 2022-04-25 12:26:03 -07:00
googletest-timeout.py [lit] Keep stdout/stderr when using GoogleTest format 2022-04-25 12:26:03 -07:00
ignore-fail.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
lit-opts.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
lit.cfg [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
lit.site.cfg.in Use lit_config.substitute instead of foo % lit_config.params everywhere 2022-03-16 09:57:41 +01:00
lld-features.py
max-failures.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
max-time.py
parallelism-groups.py
progress-bar.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
reorder.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
selecting.py
shell-parsing.py
show-result-codes.py
show-used-features.py
shtest-encoding.py
shtest-env.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-format-argv0.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-format.py Make shtest-format.py CHECK lines more flexible 2022-02-10 13:50:10 -08:00
shtest-if-else.py [lit] Support %if ... %else syntax for RUN lines 2022-04-27 20:29:08 +03:00
shtest-inject.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-keyword-parse-errors.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-not.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-output-printing.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-recursive-substitution.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-run-at-line.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-shell.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
shtest-timeout.py
test-data-micro.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
test-data.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
test-output-micro-resultdb.py
test-output-micro.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
test-output-resultdb.py [Reland][lit] Use sharding for GoogleTest format 2022-04-12 14:51:12 -07:00
test-output.py [llvm] [lit] Support forcing lexical test order 2021-08-27 20:47:11 +02:00
unittest-adaptor.py
unparsed-requirements.py
usage.py
use-llvm-tool.py
xfail-cl.py
xunit-output.py