[lit] Print substitutions with --show-suites
authorLouis Dionne <ldionne@apple.com>
Thu, 9 Apr 2020 18:34:58 +0000 (14:34 -0400)
committerLouis Dionne <ldionne@apple.com>
Mon, 13 Apr 2020 16:01:12 +0000 (12:01 -0400)
commitdd3feecd7304bf611aa49247383fb78f51a9a6ab
treee0ed102967572893d263b76160a3dcbb55b1c721
parenta59ba3384e9d5e1cf89ddae1d14601a613b8d7b7
[lit] Print substitutions with --show-suites

We already print available features, and it can be useful to print
substitutions as well since those are a pretty fundamental part of
a test suite. We could also consider printing other things like the
test environment, however the need doesn't appear to be as strong.

As a fly-by fix, we also always print available features, even when
there are none.

Before:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features : -faligned-allocation -fsized-deallocation [...]

After:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features: -faligned-allocation -fsized-deallocation [...]
      Available Substitutions: %{build_module} => [...]
                               %{build} => %{cxx} -o [...]

Differential Revision: https://reviews.llvm.org/D77818
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/discovery/lit.cfg
llvm/utils/lit/tests/discovery.py