diff options
| author | Stefan Boberg <[email protected]> | 2023-05-02 10:01:47 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-02 10:01:47 +0200 |
| commit | 075d17f8ada47e990fe94606c3d21df409223465 (patch) | |
| tree | e50549b766a2f3c354798a54ff73404217b4c9af /src/zentest-appstub | |
| parent | fix: bundle shouldn't append content zip to zen (diff) | |
| download | zen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz zen-075d17f8ada47e990fe94606c3d21df409223465.zip | |
moved source directories into `/src` (#264)
* moved source directories into `/src`
* updated bundle.lua for new `src` path
* moved some docs, icon
* removed old test trees
Diffstat (limited to 'src/zentest-appstub')
| -rw-r--r-- | src/zentest-appstub/xmake.lua | 16 | ||||
| -rw-r--r-- | src/zentest-appstub/zentest-appstub.cpp | 34 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/zentest-appstub/xmake.lua b/src/zentest-appstub/xmake.lua new file mode 100644 index 000000000..d8e0283c1 --- /dev/null +++ b/src/zentest-appstub/xmake.lua @@ -0,0 +1,16 @@ +-- Copyright Epic Games, Inc. All Rights Reserved. + +target("zentest-appstub") + set_kind("binary") + add_headerfiles("**.h") + add_files("*.cpp") + + if is_os("linux") then + add_syslinks("pthread") + end + + if is_plat("macosx") then + add_ldflags("-framework CoreFoundation") + add_ldflags("-framework Security") + add_ldflags("-framework SystemConfiguration") + end diff --git a/src/zentest-appstub/zentest-appstub.cpp b/src/zentest-appstub/zentest-appstub.cpp new file mode 100644 index 000000000..66e6e03fd --- /dev/null +++ b/src/zentest-appstub/zentest-appstub.cpp @@ -0,0 +1,34 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include <stdio.h> +#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; +} |