Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This behaves just like the sh/cmd.exe equivalents. pushd/popd are useful to verify path handling of the driver, typically testing prefix maps or relative path handling. Differential Revision: https://reviews.llvm.org/D125502
- Loading branch information
1 parent
b1aed14
commit e91a73d
Showing
7 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import lit.formats | ||
config.name = 'shtest-pushd-popd' | ||
config.suffixes = ['.txt'] | ||
config.test_format = lit.formats.ShTest(execute_external=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# RUN: popd invalid |
1 change: 1 addition & 0 deletions
1
llvm/utils/lit/tests/Inputs/shtest-pushd-popd/popd-no-stack.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# RUN: popd |
8 changes: 8 additions & 0 deletions
8
llvm/utils/lit/tests/Inputs/shtest-pushd-popd/pushd-popd-ok.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# RUN: rm -rf %t/UserFoo && mkdir -p %t/UserFoo/FooDocs | ||
# RUN: touch %t/UserFoo/user.txt %t/UserFoo/FooDocs/doc.txt | ||
# RUN: pushd %t/UserFoo | ||
# RUN: pushd FooDocs | ||
# RUN: cat doc.txt | ||
# RUN: popd | ||
# RUN: cat user.txt | ||
# RUN: popd |
1 change: 1 addition & 0 deletions
1
llvm/utils/lit/tests/Inputs/shtest-pushd-popd/pushd-too-many-args.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# RUN: pushd a b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Check the pushd and popd commands | ||
|
||
# RUN: not %{lit} -a -v %{inputs}/shtest-pushd-popd \ | ||
# RUN: | FileCheck -match-full-lines %s | ||
# | ||
# END. | ||
|
||
# CHECK: -- Testing: 4 tests{{.*}} | ||
|
||
# CHECK: FAIL: shtest-pushd-popd :: popd-args.txt ({{[^)]*}}) | ||
# CHECK: $ "popd" "invalid" | ||
# CHECK: 'popd' does not support arguments | ||
|
||
# CHECK: FAIL: shtest-pushd-popd :: popd-no-stack.txt ({{[^)]*}}) | ||
# CHECK: $ "popd" | ||
# CHECK: popd: directory stack empty | ||
|
||
# CHECK: FAIL: shtest-pushd-popd :: pushd-too-many-args.txt ({{[^)]*}}) | ||
# CHECK: $ "pushd" "a" "b" | ||
# CHECK: 'pushd' supports only one argument | ||
|
||
# CHECK: Passed: 1 | ||
# CHECK: Failed: 3 | ||
# CHECK-NOT: {{.}} |