diff options
| -rw-r--r-- | zentest-appstub/zentest-appstub.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/zentest-appstub/zentest-appstub.cpp b/zentest-appstub/zentest-appstub.cpp index bea50270d..66e6e03fd 100644 --- a/zentest-appstub/zentest-appstub.cpp +++ b/zentest-appstub/zentest-appstub.cpp @@ -10,15 +10,25 @@ using namespace std::chrono_literals; int main(int argc, char* argv[]) { + int ExitCode = 0; + for (int i = 0; i < argc; ++i) { if (std::strncmp(argv[i], "-t=", 3) == 0) { - int sleeptime = std::atoi(argv[i] + 3); + const int SleepTime = std::atoi(argv[i] + 3); - printf("[zentest] sleeping for %ds!", sleeptime); + printf("[zentest] sleeping for %ds...\n", SleepTime); - std::this_thread::sleep_for(sleeptime * 1s); + std::this_thread::sleep_for(SleepTime * 1s); + } + else if (std::strncmp(argv[i], "-f=", 3) == 0) + { + ExitCode = std::atoi(argv[i] + 3); } } + + printf("[zentest] exiting with exit code: %d\n", ExitCode); + + return ExitCode; } |