Skip to content

[llvm-lit][test] Resolved typo in raising InternalShellError for export command in lit's internal shell #105961

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

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/utils/lit/lit/TestRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def executeBuiltinPopd(cmd, shenv):
def executeBuiltinExport(cmd, shenv):
"""executeBuiltinExport - Set an environment variable."""
if len(cmd.args) != 2:
raise InternalShellError("'export' supports only one argument")
raise InternalShellError(cmd, "'export' supports only one argument")
updateEnv(shenv, cmd.args)
return ShellCommandResult(cmd, "", "", 0, False)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Test export command with too many arguments.
# RUN: export FOO=1 BAR=2
7 changes: 7 additions & 0 deletions llvm/utils/lit/tests/Inputs/shtest-export/lit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import lit.formats

config.name = "shtest-export"
config.suffixes = [".txt"]
config.test_format = lit.formats.ShTest()
config.test_source_root = None
config.test_exec_root = None
12 changes: 12 additions & 0 deletions llvm/utils/lit/tests/shtest-export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Test the export command.

# RUN: not %{lit} -a -v %{inputs}/shtest-export \
# RUN: | FileCheck -match-full-lines %s
#
# END.

# CHECK: FAIL: shtest-export :: export-too-many-args.txt {{.*}}
# CHECK: export FOO=1 BAR=2
# CHECK: # executed command: export FOO=1 BAR=2
# CHECK: # | 'export' supports only one argument
# CHECK: # error: command failed with exit status: {{.*}}
Loading