aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver-test/zenserver-test.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-01 12:40:20 +0100
committerGitHub Enterprise <[email protected]>2026-03-01 12:40:20 +0100
commit4d01aaee0a45f4c9f96e8a4925eff696be98de8d (patch)
treea0cefd6ef899f77a98370f52079b86af3db0d070 /src/zenserver-test/zenserver-test.cpp
parentsubprocess tracking using Jobs on Windows/hub (#796) (diff)
downloadzen-4d01aaee0a45f4c9f96e8a4925eff696be98de8d.tar.xz
zen-4d01aaee0a45f4c9f96e8a4925eff696be98de8d.zip
added `--verbose` option to zenserver-test and `xmake test` (#798)
* when `--verbose` is specified to zenserver-test, all child process output (typically, zenserver instances) is piped through to stdout. you can also pass `--verbose` to `xmake test` to accomplish the same thing. * this PR also consolidates all test runner `main` function logic (such as from zencore-test, zenhttp-test etc) into central implementation in zencore for consistency and ease of maintenance * also added extended utf8-tests including a fix to `Utf8ToWide()`
Diffstat (limited to 'src/zenserver-test/zenserver-test.cpp')
-rw-r--r--src/zenserver-test/zenserver-test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/zenserver-test/zenserver-test.cpp b/src/zenserver-test/zenserver-test.cpp
index 4120dec1a..c7ce633d3 100644
--- a/src/zenserver-test/zenserver-test.cpp
+++ b/src/zenserver-test/zenserver-test.cpp
@@ -4,7 +4,6 @@
#if ZEN_WITH_TESTS
-# define ZEN_TEST_WITH_RUNNER 1
# include "zenserver-test.h"
# include <zencore/except.h>
@@ -97,6 +96,7 @@ main(int argc, char** argv)
// somehow in the future
std::string ServerClass;
+ bool Verbose = false;
for (int i = 1; i < argc; ++i)
{
@@ -107,10 +107,19 @@ main(int argc, char** argv)
ServerClass = argv[++i];
}
}
+ else if (argv[i] == "--verbose"sv)
+ {
+ Verbose = true;
+ }
}
zen::tests::TestEnv.InitializeForTest(ProgramBaseDir, TestBaseDir, ServerClass);
+ if (Verbose)
+ {
+ zen::tests::TestEnv.SetPassthroughOutput(true);
+ }
+
ZEN_INFO("Running tests...(base dir: '{}')", TestBaseDir);
zen::testing::TestRunner Runner;