test/test.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
New commits: commit 3c52aff8cfc4c9b9a965dc1723c14de6c6f9fe58 Author: Ashod Nakashian <[email protected]> AuthorDate: Sun Sep 22 12:37:32 2019 -0400 Commit: Ashod Nakashian <[email protected]> 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 <[email protected]> Tested-by: Ashod Nakashian <[email protected]> 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; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
