forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip any leading directory path from the argv[0] program name in `pu…
…re2-main-args` test to have consistent results on CI agent as well as local runs (hsutter#947)
- Loading branch information
1 parent
087af3c
commit c14d78b
Showing
6 changed files
with
23 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
main: (args) = | ||
main: (args) = { | ||
exe: std::string = args.argv[0]; | ||
pos:= exe.find_last_of("/\\"); | ||
if pos != std::string::npos { | ||
pos++; | ||
exe = exe.substr(pos, exe.size() - pos); | ||
} | ||
std::cout | ||
<< "args.argc is (args.argc)$\n" | ||
<< "args.argv[0] is (args.argv[0])$\n" | ||
<< "args.argv[0] is (exe)$\n" | ||
; | ||
} |
2 changes: 1 addition & 1 deletion
2
regression-tests/test-results/apple-clang-14/pure2-main-args.cpp.execution
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
args.argc is 1 | ||
args.argv[0] is ./test.exe | ||
args.argv[0] is test.exe |
2 changes: 1 addition & 1 deletion
2
regression-tests/test-results/clang-12/pure2-main-args.cpp.execution
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
args.argc is 1 | ||
args.argv[0] is ./test.exe | ||
args.argv[0] is test.exe |
2 changes: 1 addition & 1 deletion
2
regression-tests/test-results/gcc-10/pure2-main-args.cpp.execution
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
args.argc is 1 | ||
args.argv[0] is ./test.exe | ||
args.argv[0] is test.exe |
2 changes: 1 addition & 1 deletion
2
regression-tests/test-results/gcc-13/pure2-main-args.cpp.execution
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
args.argc is 1 | ||
args.argv[0] is ./test.exe | ||
args.argv[0] is test.exe |
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