aboutsummaryrefslogtreecommitdiff
path: root/src/zentest-appstub/zentest-appstub.cpp
blob: 24cf21e97faea125d2b57614f0a0134ca6465b93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright Epic Games, Inc. All Rights Reserved.

#include <stdio.h>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <thread>

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)
		{
			const int SleepTime = std::atoi(argv[i] + 3);

			printf("[zentest] sleeping for %ds...\n", SleepTime);

			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;
}