diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-13 09:36:26 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-12-13 09:39:20 +0100 |
commit | 6755ec891a1740110c48895afd53d39e8370704a (patch) | |
tree | 982606f3bc582262e4b315a63f55ccb141fff97b /src/testlib | |
parent | 449204f8c0d6679ae0e58dbb8a30b8a86fbdb4ec (diff) | |
parent | 00c9ec63a552d040e851b561c11428fabf1a2b08 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
configure
qmake/Makefile.unix.macos
qmake/Makefile.unix.win32
qmake/generators/win32/msvc_vcproj.cpp
src/3rdparty/pcre/qt_attribution.json
src/corelib/io/qsettings.cpp
src/corelib/kernel/qdeadlinetimer.cpp
src/platformsupport/kmsconvenience/qkmsdevice.cpp
src/platformsupport/kmsconvenience/qkmsdevice_p.h
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
tests/manual/qstorageinfo/printvolumes.cpp
tools/configure/configureapp.cpp
Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp | 2 | ||||
-rw-r--r-- | src/testlib/doc/src/qttestlib-manual.qdoc | 29 | ||||
-rw-r--r-- | src/testlib/qbenchmarkevent_p.h | 18 | ||||
-rw-r--r-- | src/testlib/qbenchmarktimemeasurers_p.h | 32 | ||||
-rw-r--r-- | src/testlib/qbenchmarkvalgrind_p.h | 16 | ||||
-rw-r--r-- | src/testlib/qplaintestlogger_p.h | 14 | ||||
-rw-r--r-- | src/testlib/qteamcitylogger_p.h | 14 | ||||
-rw-r--r-- | src/testlib/qtestcase.cpp | 19 | ||||
-rw-r--r-- | src/testlib/qtestcase.h | 2 | ||||
-rw-r--r-- | src/testlib/qtestevent.h | 16 | ||||
-rw-r--r-- | src/testlib/qtesteventloop.h | 2 | ||||
-rw-r--r-- | src/testlib/qxctestlogger.mm | 2 | ||||
-rw-r--r-- | src/testlib/qxmltestlogger_p.h | 14 | ||||
-rw-r--r-- | src/testlib/qxunittestlogger_p.h | 14 |
14 files changed, 91 insertions, 103 deletions
diff --git a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp index fdcbdc603c..a4513a55a9 100644 --- a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp +++ b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp @@ -69,7 +69,7 @@ myCustomObject->doSomething(); // trigger emission of the signal QList<QVariant> arguments = spy.takeFirst(); QVERIFY(arguments.at(0).type() == QVariant::Int); -QVERIFY(arguments.at(1).type() == QVariant::QString); +QVERIFY(arguments.at(1).type() == QVariant::String); QVERIFY(arguments.at(2).type() == QVariant::double); //! [1] diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc index d775ae5b76..6bdf6c33c7 100644 --- a/src/testlib/doc/src/qttestlib-manual.qdoc +++ b/src/testlib/doc/src/qttestlib-manual.qdoc @@ -361,35 +361,6 @@ See \l {Chapter 5: Writing a Benchmark}{Writing a Benchmark} in the Qt Test Tutorial for more benchmarking examples. - - \section1 3rd Party Code - - The CPU tick counters used for benchmarking are licensed under the following - license: (from src/testlib/3rdparty/cycle.h) - - \legalese - Copyright (c) 2003, 2006 Matteo Frigo\br - Copyright (c) 2003, 2006 Massachusetts Institute of Technology - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - \endlegalese */ /*! diff --git a/src/testlib/qbenchmarkevent_p.h b/src/testlib/qbenchmarkevent_p.h index 8231b57127..af42a17141 100644 --- a/src/testlib/qbenchmarkevent_p.h +++ b/src/testlib/qbenchmarkevent_p.h @@ -63,15 +63,15 @@ class QBenchmarkEvent : public QBenchmarkMeasurerBase, public QAbstractNativeEve public: QBenchmarkEvent(); ~QBenchmarkEvent(); - void start(); - qint64 checkpoint(); - qint64 stop(); - bool isMeasurementAccepted(qint64 measurement); - int adjustIterationCount(int suggestion); - int adjustMedianCount(int suggestion); - bool repeatCount() { return 1; } - QTest::QBenchmarkMetric metricType(); - virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); + void start() override; + qint64 checkpoint() override; + qint64 stop() override; + bool isMeasurementAccepted(qint64 measurement) override; + int adjustIterationCount(int suggestion) override; + int adjustMedianCount(int suggestion) override; + bool repeatCount() override { return 1; } + QTest::QBenchmarkMetric metricType() override; + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; qint64 eventCounter; }; diff --git a/src/testlib/qbenchmarktimemeasurers_p.h b/src/testlib/qbenchmarktimemeasurers_p.h index e5ffb1157d..f268669e2f 100644 --- a/src/testlib/qbenchmarktimemeasurers_p.h +++ b/src/testlib/qbenchmarktimemeasurers_p.h @@ -60,14 +60,14 @@ QT_BEGIN_NAMESPACE class QBenchmarkTimeMeasurer : public QBenchmarkMeasurerBase { public: - void start(); - qint64 checkpoint(); - qint64 stop(); - bool isMeasurementAccepted(qint64 measurement); - int adjustIterationCount(int sugestion); - int adjustMedianCount(int suggestion); - bool needsWarmupIteration(); - QTest::QBenchmarkMetric metricType(); + void start() override; + qint64 checkpoint() override; + qint64 stop() override; + bool isMeasurementAccepted(qint64 measurement) override; + int adjustIterationCount(int sugestion) override; + int adjustMedianCount(int suggestion) override; + bool needsWarmupIteration() override; + QTest::QBenchmarkMetric metricType() override; private: QElapsedTimer time; }; @@ -77,14 +77,14 @@ private: class QBenchmarkTickMeasurer : public QBenchmarkMeasurerBase { public: - void start(); - qint64 checkpoint(); - qint64 stop(); - bool isMeasurementAccepted(qint64 measurement); - int adjustIterationCount(int); - int adjustMedianCount(int suggestion); - bool needsWarmupIteration(); - QTest::QBenchmarkMetric metricType(); + void start() override; + qint64 checkpoint() override; + qint64 stop() override; + bool isMeasurementAccepted(qint64 measurement) override; + int adjustIterationCount(int) override; + int adjustMedianCount(int suggestion) override; + bool needsWarmupIteration() override; + QTest::QBenchmarkMetric metricType() override; private: CycleCounterTicks startTicks; }; diff --git a/src/testlib/qbenchmarkvalgrind_p.h b/src/testlib/qbenchmarkvalgrind_p.h index dd7e7381c1..69219b9a65 100644 --- a/src/testlib/qbenchmarkvalgrind_p.h +++ b/src/testlib/qbenchmarkvalgrind_p.h @@ -76,14 +76,14 @@ public: class QBenchmarkCallgrindMeasurer : public QBenchmarkMeasurerBase { public: - void start(); - qint64 checkpoint(); - qint64 stop(); - bool isMeasurementAccepted(qint64 measurement); - int adjustIterationCount(int); - int adjustMedianCount(int); - bool needsWarmupIteration(); - QTest::QBenchmarkMetric metricType(); + void start() override; + qint64 checkpoint() override; + qint64 stop() override; + bool isMeasurementAccepted(qint64 measurement) override; + int adjustIterationCount(int) override; + int adjustMedianCount(int) override; + bool needsWarmupIteration() override; + QTest::QBenchmarkMetric metricType() override; }; QT_END_NAMESPACE diff --git a/src/testlib/qplaintestlogger_p.h b/src/testlib/qplaintestlogger_p.h index efa79e550d..93d3c7143a 100644 --- a/src/testlib/qplaintestlogger_p.h +++ b/src/testlib/qplaintestlogger_p.h @@ -61,18 +61,18 @@ public: QPlainTestLogger(const char *filename); ~QPlainTestLogger(); - void startLogging(); - void stopLogging(); + void startLogging() override; + void stopLogging() override; - void enterTestFunction(const char *function); - void leaveTestFunction(); + void enterTestFunction(const char *function) override; + void leaveTestFunction() override; void addIncident(IncidentTypes type, const char *description, - const char *file = 0, int line = 0); - void addBenchmarkResult(const QBenchmarkResult &result); + const char *file = 0, int line = 0) override; + void addBenchmarkResult(const QBenchmarkResult &result) override; void addMessage(MessageTypes type, const QString &message, - const char *file = 0, int line = 0); + const char *file = 0, int line = 0) override; private: void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0); diff --git a/src/testlib/qteamcitylogger_p.h b/src/testlib/qteamcitylogger_p.h index b8fad3ae34..219aeb5ceb 100644 --- a/src/testlib/qteamcitylogger_p.h +++ b/src/testlib/qteamcitylogger_p.h @@ -63,18 +63,18 @@ public: QTeamCityLogger(const char *filename); ~QTeamCityLogger(); - void startLogging(); - void stopLogging(); + void startLogging() override; + void stopLogging() override; - void enterTestFunction(const char *function); - void leaveTestFunction(); + void enterTestFunction(const char *function) override; + void leaveTestFunction() override; void addIncident(IncidentTypes type, const char *description, - const char *file = 0, int line = 0); - void addBenchmarkResult(const QBenchmarkResult &result); + const char *file = 0, int line = 0) override; + void addBenchmarkResult(const QBenchmarkResult &result) override; void addMessage(MessageTypes type, const QString &message, - const char *file = 0, int line = 0); + const char *file = 0, int line = 0) override; private: QString currTestFuncName; diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index c175967054..1f07ff3f91 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -99,6 +99,7 @@ #include <errno.h> #include <signal.h> #include <time.h> +#include <sys/resource.h> #endif #if defined(Q_OS_MACX) @@ -180,6 +181,22 @@ static bool debuggerPresent() #endif } +static void disableCoreDump() +{ + bool ok = false; + const int disableCoreDump = qEnvironmentVariableIntValue("QTEST_DISABLE_CORE_DUMP", &ok); + if (ok && disableCoreDump == 1) { +#if defined(Q_OS_UNIX) + struct rlimit limit; + limit.rlim_cur = 0; + limit.rlim_max = 0; + if (setrlimit(RLIMIT_CORE, &limit) != 0) + qWarning("Failed to disable core dumps: %d", errno); +#endif + } +} +Q_CONSTRUCTOR_FUNCTION(disableCoreDump); + static void stackTrace() { bool ok = false; @@ -962,7 +979,7 @@ public: waitCondition.wakeAll(); } - void run() { + void run() override { QMutexLocker locker(&mutex); waitCondition.wakeAll(); while (1) { diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index c3ccfc3f8c..4c226830e9 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -309,7 +309,7 @@ namespace QTest Q_TESTLIB_EXPORT void addColumnInternal(int id, const char *name); template <typename T> - inline void addColumn(const char *name, T * = 0) + inline void addColumn(const char *name, T * = nullptr) { typedef std::is_same<T, const char*> QIsSameTConstChar; Q_STATIC_ASSERT_X(!QIsSameTConstChar::value, "const char* is not allowed as a test data format."); diff --git a/src/testlib/qtestevent.h b/src/testlib/qtestevent.h index 63b7401e6f..159e3e01ff 100644 --- a/src/testlib/qtestevent.h +++ b/src/testlib/qtestevent.h @@ -79,10 +79,10 @@ public: inline QTestKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers, int delay) : _action(action), _delay(delay), _modifiers(modifiers), _ascii(ascii), _key(Qt::Key_unknown) {} - inline QTestEvent *clone() const { return new QTestKeyEvent(*this); } + inline QTestEvent *clone() const override { return new QTestKeyEvent(*this); } #ifdef QT_WIDGETS_LIB - inline void simulate(QWidget *w) + inline void simulate(QWidget *w) override { if (_ascii == 0) QTest::keyEvent(_action, w, _key, _modifiers, _delay); @@ -104,10 +104,10 @@ class QTestKeyClicksEvent: public QTestEvent public: inline QTestKeyClicksEvent(const QString &keys, Qt::KeyboardModifiers modifiers, int delay) : _keys(keys), _modifiers(modifiers), _delay(delay) {} - inline QTestEvent *clone() const { return new QTestKeyClicksEvent(*this); } + inline QTestEvent *clone() const override { return new QTestKeyClicksEvent(*this); } #ifdef QT_WIDGETS_LIB - inline void simulate(QWidget *w) + inline void simulate(QWidget *w) override { QTest::keyClicks(w, _keys, _modifiers, _delay); } @@ -125,10 +125,10 @@ public: inline QTestMouseEvent(QTest::MouseAction action, Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint position, int delay) : _action(action), _button(button), _modifiers(modifiers), _pos(position), _delay(delay) {} - inline QTestEvent *clone() const { return new QTestMouseEvent(*this); } + inline QTestEvent *clone() const override { return new QTestMouseEvent(*this); } #ifdef QT_WIDGETS_LIB - inline void simulate(QWidget *w) + inline void simulate(QWidget *w) override { QTest::mouseEvent(_action, w, _button, _modifiers, _pos, _delay); } @@ -148,10 +148,10 @@ class QTestDelayEvent: public QTestEvent { public: inline QTestDelayEvent(int msecs): _delay(msecs) {} - inline QTestEvent *clone() const { return new QTestDelayEvent(*this); } + inline QTestEvent *clone() const override { return new QTestDelayEvent(*this); } #ifdef QT_WIDGETS_LIB - inline void simulate(QWidget * /*w*/) { QTest::qWait(_delay); } + inline void simulate(QWidget * /*w*/) override { QTest::qWait(_delay); } #endif private: diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h index 032c95d692..bcf4a4be2d 100644 --- a/src/testlib/qtesteventloop.h +++ b/src/testlib/qtesteventloop.h @@ -80,7 +80,7 @@ public Q_SLOTS: inline void exitLoop(); protected: - inline void timerEvent(QTimerEvent *e); + inline void timerEvent(QTimerEvent *e) override; private: bool inLoop; diff --git a/src/testlib/qxctestlogger.mm b/src/testlib/qxctestlogger.mm index ffabe88db2..62fd73070f 100644 --- a/src/testlib/qxctestlogger.mm +++ b/src/testlib/qxctestlogger.mm @@ -66,7 +66,7 @@ QT_WARNING_PUSH // Ignore XCTestProbe deprecation -QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") +QT_WARNING_DISABLE_DEPRECATED // --------------------------------------------------------- diff --git a/src/testlib/qxmltestlogger_p.h b/src/testlib/qxmltestlogger_p.h index c6461387b2..b85742f939 100644 --- a/src/testlib/qxmltestlogger_p.h +++ b/src/testlib/qxmltestlogger_p.h @@ -64,18 +64,18 @@ public: QXmlTestLogger(XmlMode mode, const char *filename); ~QXmlTestLogger(); - void startLogging(); - void stopLogging(); + void startLogging() override; + void stopLogging() override; - void enterTestFunction(const char *function); - void leaveTestFunction(); + void enterTestFunction(const char *function) override; + void leaveTestFunction() override; void addIncident(IncidentTypes type, const char *description, - const char *file = 0, int line = 0); - void addBenchmarkResult(const QBenchmarkResult &result); + const char *file = 0, int line = 0) override; + void addBenchmarkResult(const QBenchmarkResult &result) override; void addMessage(MessageTypes type, const QString &message, - const char *file = 0, int line = 0); + const char *file = 0, int line = 0) override; static int xmlCdata(QTestCharBuffer *dest, char const* src); static int xmlQuote(QTestCharBuffer *dest, char const* src); diff --git a/src/testlib/qxunittestlogger_p.h b/src/testlib/qxunittestlogger_p.h index 50f26c317b..8fb01fbe61 100644 --- a/src/testlib/qxunittestlogger_p.h +++ b/src/testlib/qxunittestlogger_p.h @@ -64,19 +64,19 @@ class QXunitTestLogger : public QAbstractTestLogger QXunitTestLogger(const char *filename); ~QXunitTestLogger(); - void startLogging(); - void stopLogging(); + void startLogging() override; + void stopLogging() override; - void enterTestFunction(const char *function); - void leaveTestFunction(); + void enterTestFunction(const char *function) override; + void leaveTestFunction() override; void addIncident(IncidentTypes type, const char *description, - const char *file = 0, int line = 0); - void addBenchmarkResult(const QBenchmarkResult &result); + const char *file = 0, int line = 0) override; + void addBenchmarkResult(const QBenchmarkResult &result) override; void addTag(QTestElement* element); void addMessage(MessageTypes type, const QString &message, - const char *file = 0, int line = 0); + const char *file = 0, int line = 0) override; private: QTestElement *listOfTestcases; |