From 427e1ea3e7dea96b142035b3fb9fbe9ea3768763 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 15 Aug 2022 17:59:39 +0000 Subject: [PATCH] [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) --- llvm/docs/CommandGuide/lit.rst | 3 +++ llvm/utils/lit/lit/cl_arguments.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst index cda6de4f0c8c95..31e272636bab86 100644 --- a/llvm/docs/CommandGuide/lit.rst +++ b/llvm/docs/CommandGuide/lit.rst @@ -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`. diff --git a/llvm/utils/lit/lit/cl_arguments.py b/llvm/utils/lit/lit/cl_arguments.py index a7488774802fd6..43bbd6fdaa96c4 100644 --- a/llvm/utils/lit/lit/cl_arguments.py +++ b/llvm/utils/lit/lit/cl_arguments.py @@ -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",