File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
Testing/Launcher/App4Test Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,22 @@ int check_unexpected_env_var(const char* varname)
80
80
return EXIT_SUCCESS;
81
81
}
82
82
83
+ void display_arguments(std::ostream& stream, int argc, char* argv[])
84
+ {
85
+ // Since tests are expecting the argument to be displayed as ""Argument passed: [arg1 [...]]", changing
86
+ // the following may require to update the tests.
87
+ stream << "Argument passed:";
88
+ if (argc >= 2)
89
+ {
90
+ stream << argv[1]; // argName
91
+ }
92
+ for(int idx=2; idx < argc; idx++)
93
+ {
94
+ stream << " " << argv[idx];
95
+ }
96
+ stream << std::endl;
97
+ }
98
+
83
99
int main(int argc, char** argv)
84
100
{
85
101
//std::cout << "Hello World !" << std::endl;
@@ -91,12 +107,8 @@ int main(int argc, char** argv)
91
107
std::string argName(argv[1]);
92
108
if (argName == "--foo")
93
109
{
94
- std::cout << "Argument count: " << argc << " - Argument passed:" << argName;
95
- for(int i=2; i < argc; i++)
96
- {
97
- std::cout << " " << argv[i];
98
- }
99
- std::cout << std::endl;
110
+ std::cout << "Argument count: " << argc << " - ";
111
+ display_arguments(std::cout, argc, argv);
100
112
}
101
113
else if (argName == "--test-timeout")
102
114
{
You can’t perform that action at this time.
0 commit comments