aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-06-18 15:42:41 +0200
committerStefan Boberg <[email protected]>2021-06-18 15:42:41 +0200
commit0af1780ad1ae607997ecadbd9979ee1a46d562e2 (patch)
treea318344230cac8b58d9726be89434fe1a40b78a2
parentAdded process exit code to launcher response (diff)
downloadzen-0af1780ad1ae607997ecadbd9979ee1a46d562e2.tar.xz
zen-0af1780ad1ae607997ecadbd9979ee1a46d562e2.zip
Added simple control of test executable exit code
-rw-r--r--zentest-appstub/zentest-appstub.cpp16
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;
}