[Libreoffice-commits] online.git: test/test.cpp
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Sun Sep 22 18:24:08 UTC 2019
test/test.cpp | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
New commits:
commit 3c52aff8cfc4c9b9a965dc1723c14de6c6f9fe58
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Sep 22 12:37:32 2019 -0400
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Sun Sep 22 20:23:49 2019 +0200
wsd: test: support test command-line args in any order
No longer is it necessary to run with --verbose
in case we need --debugrun.
Also, by default the log level is now warning instead
of error, which should hopefully be more useful in
troubleshooting issues (or at least to force us
better categorize log messages).
Change-Id: Iad4279ecf3bf77780adcd786d4f46d9c964f302d
Reviewed-on: https://gerrit.libreoffice.org/79351
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/test/test.cpp b/test/test.cpp
index 8df5d1e79..d5c85710c 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -69,10 +69,21 @@ static bool IsDebugrun = false;
int main(int argc, char** argv)
{
- const bool verbose = (argc > 1 && std::string("--verbose") == argv[1]);
- IsDebugrun = (argc > 2 && std::string("--debugrun") == argv[2]);
- const char* loglevel = verbose ? "trace" : "error";
+ bool verbose = false;
+ for (int i = 1; i < argc; ++i)
+ {
+ const std::string arg(argv[i]);
+ if (arg == "--verbose")
+ {
+ verbose = true;
+ }
+ else if (arg == "--debugrun")
+ {
+ IsDebugrun = true;
+ }
+ }
+ const char* loglevel = verbose ? "trace" : "warning";
Log::initialize("tst", loglevel, true, false, {});
return runClientTests(true, verbose)? 0: 1;
More information about the Libreoffice-commits
mailing list