aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp-test/zenhttp-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhttp-test/zenhttp-test.cpp')
-rw-r--r--src/zenhttp-test/zenhttp-test.cpp41
1 files changed, 12 insertions, 29 deletions
diff --git a/src/zenhttp-test/zenhttp-test.cpp b/src/zenhttp-test/zenhttp-test.cpp
index c18759beb..0a6980462 100644
--- a/src/zenhttp-test/zenhttp-test.cpp
+++ b/src/zenhttp-test/zenhttp-test.cpp
@@ -1,44 +1,27 @@
// Copyright Epic Games, Inc. All Rights Reserved.
-#include <zencore/filesystem.h>
-#include <zencore/logging.h>
-#include <zencore/memory/newdelete.h>
-#include <zencore/trace.h>
+#include <zencore/testing.h>
+#include <zenhttp/httpclient.h>
#include <zenhttp/zenhttp.h>
-#if ZEN_WITH_TESTS
-# define ZEN_TEST_WITH_RUNNER 1
-# include <zencore/testing.h>
-# include <zencore/process.h>
-#endif
+#include <zencore/memory/newdelete.h>
int
main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
{
-#if ZEN_PLATFORM_WINDOWS
- setlocale(LC_ALL, "en_us.UTF8");
-#endif // ZEN_PLATFORM_WINDOWS
-
#if ZEN_WITH_TESTS
- zen::zenhttp_forcelinktests();
-
-# if ZEN_PLATFORM_LINUX
- zen::IgnoreChildSignals();
-# endif
-
-# if ZEN_WITH_TRACE
- zen::TraceInit("zenhttp-test");
- zen::TraceOptions TraceCommandlineOptions;
- if (GetTraceOptionsFromCommandline(TraceCommandlineOptions))
+ using namespace std::literals;
+ for (int i = 1; i < argc; ++i)
{
- TraceConfigure(TraceCommandlineOptions);
+ std::string_view Arg(argv[i]);
+ if (Arg.starts_with("--httpclient="sv))
+ {
+ std::string_view Value = Arg.substr(13);
+ zen::SetDefaultHttpClientBackend(Value);
+ }
}
-# endif // ZEN_WITH_TRACE
-
- zen::logging::InitializeLogging();
- zen::MaximizeOpenFileCount();
- return ZEN_RUN_TESTS(argc, argv);
+ return zen::testing::RunTestMain(argc, argv, "zenhttp-test", zen::zenhttp_forcelinktests);
#else
return 0;
#endif