-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lit] Cope with more cat variants #121376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lit] Cope with more cat variants #121376
Conversation
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.
@llvm/pr-subscribers-testing-tools Author: Angus Lees (anguslees) ChangesBusyBox $ 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, Note this also corrects what looks like a bug with the previous regex. Full diff: https://github.com/llvm/llvm-project/pull/121376.diff 1 Files Affected:
diff --git a/llvm/utils/lit/tests/shtest-format.py b/llvm/utils/lit/tests/shtest-format.py
index 3a1959549e5d01..d58973993b272a 100644
--- a/llvm/utils/lit/tests/shtest-format.py
+++ b/llvm/utils/lit/tests/shtest-format.py
@@ -18,7 +18,7 @@
# CHECK: Command Output (stderr):
# CHECK-NEXT: --
# CHECK-NOT: --
-# CHECK: cat{{(_64)?(\.exe)?}}: {{cannot open does-not-exist|does-not-exist: No such file or directory}}
+# CHECK: cat{{(_64)?(\.exe)?}}: {{.*does-not-exist.*}}: No such file or directory
# CHECK: --
# CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt
|
Reviewers: I don't have merge permissions - so please mash the merge button yourself when you feel appropriate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/6277 Here is the relevant piece of the build log for the reference
|
…1426) The changes from #121376 has broken the ppc64 aix bot: https://lab.llvm.org/buildbot/#/builders/64/builds/1835. Adjusted the testcase to account for `cat` behaviour on AIX prior to the changes
…on AIX (#121426) The changes from llvm/llvm-project#121376 has broken the ppc64 aix bot: https://lab.llvm.org/buildbot/#/builders/64/builds/1835. Adjusted the testcase to account for `cat` behaviour on AIX prior to the changes
…1426) The changes from llvm/llvm-project#121376 has broken the ppc64 aix bot: https://lab.llvm.org/buildbot/#/builders/64/builds/1835. Adjusted the testcase to account for `cat` behaviour on AIX prior to the changes
BusyBox
cat
has yet another slight variation of error formatting: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 assertthe 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 specificAIX output, so it's unclear if this omission was intended.