[lit] Support reading arguments from a file

This allows reading arguments from file using the response file syntax.
We would like to use this in the LLVM build to pass test suites from
subbuilds.

Differential Revision: https://reviews.llvm.org/D132437

(cherry picked from commit b52820edec6f3d95edef7859a56ef30878b08382)
This commit is contained in:
Petr Hosek 2022-08-15 17:59:39 +00:00 committed by Tobias Hieta
parent 0cc033e333
commit 427e1ea3e7
2 changed files with 4 additions and 1 deletions

View file

@ -43,6 +43,9 @@ parsing options from the command line. ``LIT_OPTS`` is primarily useful for
supplementing or overriding the command-line options supplied to :program:`lit`
by ``check`` targets defined by a project's build system.
:program:`lit` can also read options from response files which are specified as
inputs using the ``@path/to/file.rsp`` syntax.
Users interested in the :program:`lit` architecture or designing a
:program:`lit` testing implementation should see :ref:`lit-infrastructure`.

View file

@ -16,7 +16,7 @@ class TestOrder(enum.Enum):
def parse_args():
parser = argparse.ArgumentParser(prog='lit')
parser = argparse.ArgumentParser(prog='lit', fromfile_prefix_chars='@')
parser.add_argument('test_paths',
nargs='+',
metavar="TEST_PATH",