diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-17 15:27:33 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-19 08:22:45 +0100 |
commit | 9ed0230bdeadc39c3015c30d700c7416617d9e0c (patch) | |
tree | 72a17014df9f6c5ce5ea5ce3f6679b214674e836 | |
parent | d261aae6a9c93ff147b82f250fe47ab7e2e88135 (diff) |
shiboken: Fix uninitialized time stamps in test log
Extract an API to start the timer of ReportHandler without
actually installing the message handler and use that from testutil.
Change-Id: I28166b9f9b8d5b0f00cda38389a1009416dac933
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken2/ApiExtractor/reporthandler.cpp | 5 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/reporthandler.h | 1 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testutil.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/reporthandler.cpp b/sources/shiboken2/ApiExtractor/reporthandler.cpp index c0c323029..ee70a8e9b 100644 --- a/sources/shiboken2/ApiExtractor/reporthandler.cpp +++ b/sources/shiboken2/ApiExtractor/reporthandler.cpp @@ -62,6 +62,11 @@ Q_LOGGING_CATEGORY(lcShiboken, "qt.shiboken") void ReportHandler::install() { qInstallMessageHandler(ReportHandler::messageOutput); + startTimer(); +} + +void ReportHandler::startTimer() +{ m_timer.start(); } diff --git a/sources/shiboken2/ApiExtractor/reporthandler.h b/sources/shiboken2/ApiExtractor/reporthandler.h index 08ab7d23c..073586055 100644 --- a/sources/shiboken2/ApiExtractor/reporthandler.h +++ b/sources/shiboken2/ApiExtractor/reporthandler.h @@ -40,6 +40,7 @@ public: enum DebugLevel { NoDebug, SparseDebug, MediumDebug, FullDebug }; static void install(); + static void startTimer(); static DebugLevel debugLevel(); static void setDebugLevel(DebugLevel level); diff --git a/sources/shiboken2/ApiExtractor/tests/testutil.h b/sources/shiboken2/ApiExtractor/tests/testutil.h index 9a2faad5c..e24e54365 100644 --- a/sources/shiboken2/ApiExtractor/tests/testutil.h +++ b/sources/shiboken2/ApiExtractor/tests/testutil.h @@ -44,6 +44,7 @@ namespace TestUtil const QStringList &dropTypeEntries = QStringList()) { ReportHandler::setSilent(silent); + ReportHandler::startTimer(); TypeDatabase* td = TypeDatabase::instance(true); if (apiVersion.isEmpty()) TypeDatabase::clearApiVersions(); |