test/countloolkits.hpp | 9 ++++++++- test/helpers.hpp | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-)
New commits: commit acbc8c1312082121a344bb34da6a50a865abbec2 Author: Ashod Nakashian <[email protected]> AuthorDate: Sat Oct 12 13:51:56 2019 -0400 Commit: Michael Meeks <[email protected]> CommitDate: Mon Oct 28 10:49:25 2019 +0100 test: log the time in tests Useful to match with the timestamps in WSD and align events when investigating test failures (or when trying to figure out the activity matching certain actions/commands). Reviewed-on: https://gerrit.libreoffice.org/80893 Reviewed-by: Andras Timar <[email protected]> Tested-by: Andras Timar <[email protected]> (cherry picked from commit b06ea528fe9dac854a18d4a9255ac598830dbb2c) Change-Id: I73a0eb8e55ee7ca1b8935bd42468f53d7a82f80b Reviewed-on: https://gerrit.libreoffice.org/81564 Reviewed-by: Michael Meeks <[email protected]> Tested-by: Michael Meeks <[email protected]> diff --git a/test/countloolkits.hpp b/test/countloolkits.hpp index 782b19b50..86c3ef724 100644 --- a/test/countloolkits.hpp +++ b/test/countloolkits.hpp @@ -59,7 +59,14 @@ static int countLoolKitProcesses(const int expected) TST_LOG_END; if (expected != count) { - TST_LOG("Found " << count << " LoKit processes but was expecting " << expected << "."); + TST_LOG_BEGIN("Found " << count << " LoKit processes but was expecting " << expected << ": ["); + for (int i : getKitPids()) + { + TST_LOG_APPEND(i << ' '); + } + TST_LOG_APPEND(']'); + TST_LOG_END; + } std::vector<int> pids = getKitPids(); diff --git a/test/helpers.hpp b/test/helpers.hpp index 19bf0b516..cfbeb4e59 100644 --- a/test/helpers.hpp +++ b/test/helpers.hpp @@ -49,7 +49,10 @@ fprintf(stderr, "%s", stream.str().c_str()); } #endif -#define TST_LOG_NAME_BEGIN(NAME, X) do { std::ostringstream str; str << NAME << "(@" << helpers::timeSinceTestStartMs() << "ms) " << X; tstLog(str); } while (false) +#define TST_LOG_NAME_BEGIN(NAME, X) do { \ + char t[64]; Poco::DateTime time; snprintf(t, sizeof(t), "%.2u:%.2u:%.2u.%.6u (@%lums) ", \ + time.hour(), time.minute(), time.second(), time.millisecond() * 1000 + time.microsecond(), helpers::timeSinceTestStartMs()); \ + std::ostringstream str; str << NAME << t << X; tstLog(str); } while (false) #define TST_LOG_BEGIN(X) TST_LOG_NAME_BEGIN(testname, X) #define TST_LOG_APPEND(X) do { std::ostringstream str; str << X; tstLog(str); } while (false) #define TST_LOG_END do { std::ostringstream str; str << "| " << __FILE__ << ':' << __LINE__ << std::endl; tstLog(str); } while (false) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
