[llvm] [llvm] Proofread TestingGuide.rst (PR #152089)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 5 00:04:07 PDT 2025
================
@@ -224,55 +224,55 @@ only directories does not need the ``lit.local.cfg`` file. Read the :doc:`Lit
documentation <CommandGuide/lit>` for more information.
Each test file must contain lines starting with "RUN:" that tell :program:`lit`
-how to run it. If there are no RUN lines, :program:`lit` will issue an error
+how to run it. If there are no ``RUN`` lines, :program:`lit` will issue an error
while running a test.
-RUN lines are specified in the comments of the test program using the
+``RUN`` lines are specified in the comments of the test program using the
keyword ``RUN`` followed by a colon, and lastly the command (pipeline)
to execute. Together, these lines form the "script" that :program:`lit`
-executes to run the test case. The syntax of the RUN lines is similar to a
+executes to run the test case. The syntax of the ``RUN`` lines is similar to a
shell's syntax for pipelines including I/O redirection and variable
substitution. However, even though these lines may *look* like a shell
-script, they are not. RUN lines are interpreted by :program:`lit`.
+script, they are not. ``RUN`` lines are interpreted by :program:`lit`.
Consequently, the syntax differs from shell in a few ways. You can specify
-as many RUN lines as needed.
+as many ``RUN`` lines as needed.
-:program:`lit` performs substitution on each RUN line to replace LLVM tool names
+:program:`lit` performs substitution on each ``RUN`` line to replace LLVM tool names
with the full paths to the executable built for each tool (in
``$(LLVM_OBJ_ROOT)/bin``). This ensures that :program:`lit` does
not invoke any stray LLVM tools in the user's path during testing.
-Each RUN line is executed on its own, distinct from other lines unless
-its last character is ``\``. This continuation character causes the RUN
-line to be concatenated with the next one. In this way you can build up
+Each ``RUN`` line is executed on its own, distinct from other lines unless
+its last character is ``\``. This continuation character causes the ``RUN``
+line to be concatenated with the next one. In this way, you can build up
long pipelines of commands without making huge line lengths. The lines
-ending in ``\`` are concatenated until a RUN line that doesn't end in
-``\`` is found. This concatenated set of RUN lines then constitutes one
+ending in ``\`` are concatenated until a ``RUN`` line that doesn't end in
+``\`` is found. This concatenated set of ``RUN`` lines then constitutes one
execution. :program:`lit` will substitute variables and arrange for the pipeline
to be executed. If any process in the pipeline fails, the entire line (and
test case) fails too.
-Below is an example of legal RUN lines in a ``.ll`` file:
+Below is an example of legal ``RUN`` lines in a ``.ll`` file:
.. code-block:: llvm
; RUN: llvm-as < %s | llvm-dis > %t1
; RUN: llvm-dis < %s.bc-13 > %t2
; RUN: diff %t1 %t2
-As with a Unix shell, the RUN lines permit pipelines and I/O
+As with a Unix shell, the ``RUN`` lines permit pipelines and I/O
redirection to be used.
There are some quoting rules that you must pay attention to when writing
-your RUN lines. In general nothing needs to be quoted. :program:`lit` won't
+your ``RUN`` lines. In general, nothing needs to be quoted. :program:`lit` won't
strip off any quote characters so they will get passed to the invoked program.
----------------
jh7370 wrote:
```suggestion
strip off any quote characters, so they will get passed to the invoked program.
```
https://github.com/llvm/llvm-project/pull/152089
More information about the llvm-commits
mailing list