diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-09-22 12:37:32 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2019-09-22 20:23:49 +0200 |
commit | 3c52aff8cfc4c9b9a965dc1723c14de6c6f9fe58 (patch) | |
tree | a114f600b7f425131392c3dddb6d47b59eedcad3 /test/test.cpp | |
parent | 720c26176a09d8622cb7a8414b555b6f4f986d58 (diff) |
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@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'test/test.cpp')
-rw-r--r-- | test/test.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
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; |