Skip to content

Commit ebdb6cf

Browse files
authored
[lit] Cope with more cat variants (#121376)
BusyBox `cat` has yet another slight variation of error formatting: ```console $ cat --help 2>&1 | head -1 BusyBox v1.37.0 (2024-09-30 10:39:57 UTC) multi-call binary. $ cat does-not-exist cat: can't open 'does-not-exist': No such file or directory ``` Rather than extend the test result regex with a third case, recognise that we only really care about the filename and errno string. Weaken the regex to ignore all "noise" around the filename. Note this also corrects what looks like a bug with the previous regex. Previously, the `cannot open does-not-exist` alternate did not assert the following errno message. This was introduced in https://reviews.llvm.org/D60553 (apparently) due to differences in the `cat` command on AIX. That bug doesn't include the specific AIX output, so it's unclear if this omission was intended.
1 parent 018b32c commit ebdb6cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/lit/tests/shtest-format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# CHECK: Command Output (stderr):
1919
# CHECK-NEXT: --
2020
# CHECK-NOT: --
21-
# CHECK: cat{{(_64)?(\.exe)?}}: {{cannot open does-not-exist|does-not-exist: No such file or directory}}
21+
# CHECK: cat{{(_64)?(\.exe)?}}: {{.*does-not-exist.*}}: No such file or directory
2222
# CHECK: --
2323

2424
# CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt

0 commit comments

Comments
 (0)