diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-02-01 17:02:19 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-02-02 23:08:37 +0100 |
commit | a605b9297d03943dbd7464f823460c9934aa2c31 (patch) | |
tree | 8f1eafcb567e0bfa01650a20b4d6b90f80edc9b6 /src/testlib/qplaintestlogger_p.h | |
parent | 63f79d7ffb22de89a2c6314caa5b5a1908590063 (diff) |
QPlainTestLogger: do not print "failure location" if there's no failure
When running a test under increased verbosity levels, QTestLib would
print "failure location" for every QTest function (QVERIFY, QCOMPARE,
...), even if there's no failure at all.
Keep the code centralized, but split the formatting of failures and
non-failures (other messages).
Task-number: QTBUG-96844
Change-Id: I3c508653176b68579dc0eb0cffcc153a52da2e2c
Pick-to: 5.15 6.2 6.3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/testlib/qplaintestlogger_p.h')
-rw-r--r-- | src/testlib/qplaintestlogger_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/testlib/qplaintestlogger_p.h b/src/testlib/qplaintestlogger_p.h index 80ef4864c1..1a19b99442 100644 --- a/src/testlib/qplaintestlogger_p.h +++ b/src/testlib/qplaintestlogger_p.h @@ -78,7 +78,12 @@ public: const char *file = nullptr, int line = 0) override; private: - void printMessage(const char *type, const char *msg, const char *file = nullptr, int line = 0); + enum class MessageSource { + Incident, + Other, + }; + void printMessage(MessageSource source, const char *type, const char *msg, + const char *file = nullptr, int line = 0); void outputMessage(const char *str); void printBenchmarkResult(const QBenchmarkResult &result); }; |