[llvm] [llvm-lit][test] Precommit tests for lit's built-in cat command (PR #101530)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 01:04:24 PDT 2024


================
@@ -0,0 +1,31 @@
+## Test the cat command
+
+# RUN: not %{lit} -a -v %{inputs}/shtest-cat \
+# RUN: | FileCheck -match-full-lines %s
+#
+# END.
+
+# CHECK: FAIL: shtest-cat :: cat-e.txt ({{[^)]*}})
+# CHECK: cat -e {{.+}}/allchars | FileCheck {{.*}}
+# CHECK: # executed command: cat -e {{.+}}/allchars
+# CHECK: # | Unsupported: 'cat':  option -e not recognized
+# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK: # executed command: FileCheck {{.*}}
+# CHECK: # error: command failed with exit status: {{.*}}
+
+# CHECK: PASS: shtest-cat :: cat-v.txt ({{[^)]*}})
+# CHECK: cat -v {{.+}}/allchars | FileCheck {{.*}}
+# CHECK-NEXT: # executed command: cat -v {{.+}}/allchars
+# CHECK-NEXT: # executed command: FileCheck {{.*}}
+# CHECK: cat -v {{.+}}/newline | FileCheck {{.*}}
+# CHECK-NEXT: # executed command: cat -v {{.+}}/newline
+# CHECK-NEXT: # executed command: FileCheck {{.*}}
+
+# CHECK: PASS: shtest-cat :: cat.txt ({{[^)]*}})
+# CHECK: cat {{.+}}/newline | FileCheck {{.*}}
+# CHECK-NEXT: # executed command: cat {{.+}}/newline
+# CHECK-NEXT: # executed command: FileCheck {{.*}}
+# CHECK: cat {{.+}}/allchars > {{.+}}
+# CHECK-NEXT: # executed command: cat {{.+}}/allchars
+# CHECK: diff {{.+}}/allchars {{.+}}
+# CHECK-NEXT: # executed command: diff {{.+}}/allchars {{.+}}
----------------
jh7370 wrote:

Missing new line at EOF.

https://github.com/llvm/llvm-project/pull/101530


More information about the llvm-commits mailing list