Skip to content

[llvm-lit] lit internal shell does not support -e option for cat commands #102377

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

Closed
connieyzhu opened this issue Aug 7, 2024 · 1 comment · Fixed by #104878
Closed

[llvm-lit] lit internal shell does not support -e option for cat commands #102377

connieyzhu opened this issue Aug 7, 2024 · 1 comment · Fixed by #104878

Comments

@connieyzhu
Copy link
Contributor

lit’s internal shell currently does not support the -e option for cat, which gives an error when running the lldb test referenced below.

Error message:

FAIL: lldb-shell :: Driver/TestUseColor.test (1 of 2512)
******************** TEST 'lldb-shell :: Driver/TestUseColor.test' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 4
cat -e /usr/local/google/home/harinidonthula/llvm-project/build/tools/lldb/test/Shell/Driver/Output/TestUseColor.test.tmp | /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck /usr/local/google/home/harinidonthula/llvm-project/lldb/test/Shell/Driver/TestUseColor.test --check-prefix COLOR
# executed command: cat -e /usr/local/google/home/harinidonthula/llvm-project/build/tools/lldb/test/Shell/Driver/Output/TestUseColor.test.tmp
# .---command stderr------------
# | Unsupported: 'cat':  option -e not recognized
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck /usr/local/google/home/harinidonthula/llvm-project/lldb/test/Shell/Driver/TestUseColor.test --check-prefix COLOR
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck /usr/local/google/home/harinidonthula/llvm-project/lldb/test/Shell/Driver/TestUseColor.test --check-prefix COLOR
# `-----------------------------
# error: command failed with exit status: 2
@llvmbot
Copy link
Member

llvmbot commented Aug 7, 2024

@llvm/issue-subscribers-lldb

Author: Connie (connieyzhu)

lit’s internal shell currently does not support the `-e` option for `cat`, which gives an error when running the lldb test referenced below.

Error message:

FAIL: lldb-shell :: Driver/TestUseColor.test (1 of 2512)
******************** TEST 'lldb-shell :: Driver/TestUseColor.test' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 4
cat -e /usr/local/google/home/harinidonthula/llvm-project/build/tools/lldb/test/Shell/Driver/Output/TestUseColor.test.tmp | /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck /usr/local/google/home/harinidonthula/llvm-project/lldb/test/Shell/Driver/TestUseColor.test --check-prefix COLOR
# executed command: cat -e /usr/local/google/home/harinidonthula/llvm-project/build/tools/lldb/test/Shell/Driver/Output/TestUseColor.test.tmp
# .---command stderr------------
# | Unsupported: 'cat':  option -e not recognized
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck /usr/local/google/home/harinidonthula/llvm-project/lldb/test/Shell/Driver/TestUseColor.test --check-prefix COLOR
# .---command stderr------------
# | FileCheck error: '&lt;stdin&gt;' is empty.
# | FileCheck command line:  /usr/local/google/home/harinidonthula/llvm-project/build/bin/FileCheck /usr/local/google/home/harinidonthula/llvm-project/lldb/test/Shell/Driver/TestUseColor.test --check-prefix COLOR
# `-----------------------------
# error: command failed with exit status: 2

ilovepi pushed a commit that referenced this issue Aug 20, 2024
…ernal shell (#104878)

This patch changes the test that uses the `cat -e` option to `cat -v` so
that the test can be run using lit's internal shell. For `cat`, the `-v`
option prints non-printing characters in ^ and M- notation, while the
`-e` option adds `$` to the end of lines in addition to printing
non-printing characters in ^ and M- notation. This is an alternative
patch to #102061, opting to
rewrite the test that uses `cat -e` instead of extending support to the
`-e` option.

Fixes #102377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants