summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix linking from Qt Test to Qt Quick TestTopi Reinio2018-12-142-4/+8
| | | | | Change-Id: I5552fde06f7cc383e1b16cd90ca9fe7cfeb3a436 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-121-3/+4
| | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-081-0/+7
|\ | | | | | | Change-Id: Ied1194730e75a6f30839bbf5429aa2699230288e
| * QTest: Make QCOMPARE of QCborError produce outputThiago Macieira2018-12-071-0/+7
| | | | | | | | | | | | | | | | | | I was getting: Actual (reader.validate()) : <null> Expected (QCborError::NoError): NoError Change-Id: Ib47c56818178458a88b4fffd1554f1751f447086 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-041-1/+10
|\| | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
| * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-11-271-1/+10
| |\ | | | | | | | | | Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
| | * Make QCOMPARE()'s handling of non-finite float match doubleEdward Welbourne2018-11-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | The qCompare() implementation for double was handling infinities and NaN the way tests need, but the one for float didn't; it has just the same need, so apply the same fix. Extends 79493a3ee1. Change-Id: I8425026acb61d535e449f579b77fdcd609157f7c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-191-1/+1
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| | * Adjust QTRY_IMPL()'s default timestepEdward Welbourne2018-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was previously using 50ms steps, which was a bad choice for client code whose total time-out was comparable to 50ms or less. Reduce the time-step so that we loop several times within the timeout (but make sure it's never zero, by adding 1ms). Change-Id: I0428a7741c0741dfb312e40ae1eda900050195ab Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Add qfloat16 support to QCOMPAREAllan Sandfeld Jensen2018-11-202-0/+23
| | | | | | | | | | | | | | | | | | Change-Id: Ide06f215a888328308a06e7e48edd666f790a5f0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Testlib: Explicitly cast messages to const char *Ulf Hermann2018-11-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Macro parameters should always be enclosed in braces when used. Plain C strings passed in parantheses are interpreted as const char[], at least by clang-tidy. Implicitly decaying arrays into pointers should be avoided and clang-tidy warns about this. Avoid both problems by always static casting all messages to const char *. Change-Id: I2be668169bec2823f69af3aa75086a31b0b31938 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Test and document QTest::toHexRepresentation()Edward Welbourne2018-11-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not actually exercised by anything in our source tree, but is potentially useful and has been part of the documented public API for some time. So mention that the caller is responsible for delete[]ing its return and add a test that exercises it. Task-number: QTPM-1385 Change-Id: Ifc5284b9eb1b678cf3c9708c681311e874838fc6 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Fix use of deprecated ItemDataRoles Background/TextColorRoleChristian Ehrlicher2018-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace BackgroundColorRole/TextColorRole with BackgroundRole/ForegroundRole and explicit deprecate them for 5.13 Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Clean up some array dereferncingEdward Welbourne2018-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Use array dereferencing notation ptr[expr] rather than the more verbose and less readable *(ptr + expr). Change-Id: Ie98986e7f622aa1a94f3f14bc362ed65767f9d92 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Remove some unused code from QTestCoreListEdward Welbourne2018-11-011-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A count(T *list) was declared but not defined; and the plain count() that was defined isn't called by anything. It's in a private header, so can be removed without harm. Task-number: QTPM-1385 Change-Id: I1ac580d57996895a4123b4f55fa984e9c8001ecb Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | More const; don't take mutable char *argv[] where const is all we needEdward Welbourne2018-11-011-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | QTest::qtest_qParseArgs() takes a needlessly mutable parameter. This needs transient legacy version until qtdeclarative is converted to use the const-qualified variant. Change-Id: I19fad25423f6f1ea7d5fac537815f4f633ac4405 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Dedent a block of code in a namespace for consistency with the rest of the blockEdward Welbourne2018-11-011-49/+49
| | | | | | | | | | | | | | | Change-Id: I98920db658547f5301d31ffdc9efb6fdd6f6fc5a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-253-134/+142
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * | Update 3rdparty valgrind headers to Valgrind 3.14.0Albert Astals Cid2018-10-172-134/+137
| | | | | | | | | | | | | | | | | | Change-Id: I8d36f03e52ad77e89d92a9df4d3bff389bd3baf2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Doc: Clarify that BC does not apply to Qt TestPaul Wicking2018-10-161-0/+5
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-17531 Change-Id: I59c02f456a16a48391247fdf7010358ad013c0ac Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Bring QTestPrivate::checkBlackLists() backLiang Qi2018-10-153-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 641eb4a965. Task-number: QTBUG-71141 Change-Id: I423332cc89db4b8137e71fdd57798039d429d0d2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Remove GPU_BLACKLIST support from QTestEdward Welbourne2018-10-124-67/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts 4fe68ffbe5c93244562f2b56292d4ecf5ce39f56, 1dfc16f6dad1cfbd843af5ca91bbb8e02774930d and 9545bee98a2431d4ef4c3449631a5fcb8d9bd57a; this feature has not been in use for some time, so is just dead code. [ChangeLog][QtTestLib] Removed support for GPU_BLACKLIST files. Reimplementations or equivalents of QTEST_MAIN() should remove their uses of QTEST_ADD_GPU_BLACKLIST_SUPPORT and its _DEFS; they are still vacuously defined, but serve no remaining purpose and shall be undefined in due course. Change-Id: I94ffd5c37ce4e1f7cf25d3c7ae8d40696b74c911 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Update 3rdparty valgrind headers to Valgrind 3.13.0Edward Welbourne2018-10-084-1510/+4203
| | | | | | | | | | | | | | | | The version we're using is at least seven years old. Let's try staying up to date ... Change-Id: I450a2fc37c22740fe554a81b471bf0fad340498e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-081-1/+1
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qtimezoneprivate.cpp Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
| * Fix ICE on QNX 6.6Sergio Martins2018-10-051-1/+1
| | | | | | | | | | | | | | qabstractitemmodeltester.cpp:223:31: internal compiler error: in expand_expr_real_1, at expr.c:9170 Change-Id: I098c1bdf706512c91c649205f4675de0ca374227 Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-271-2/+2
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/widgets/util/qcompleter.cpp Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
| * Modernize the "datestring" featureLiang Qi2018-09-241-2/+2
| | | | | | | | | | | | Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-073-0/+6
|\| | | | | | | Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
| * Doc: Check before including the \snippet from a .pro fileVenugopal Shivashankar2018-08-303-0/+6
| | | | | | | | | | | | Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Remove codepaths and checks for unsupported Apple platformsTor Arne Vestbø2018-08-311-42/+34
| | | | | | | | | | | | | | We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3. Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-08-221-0/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qtextengine.cpp tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
| * Document version of copied valgrind, kernel headersKai Koehne2018-08-201-0/+3
| | | | | | | | | | | | Task-number: QTBUG-69276 Change-Id: If2d5d796fd9d414a41036187a178d88c2e93b5ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Modernize the "thread" featureUlf Hermann2018-08-171-1/+17
| | | | | | | | | | | | | | | | | | | | Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-5/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * Doc: Remove reference to QTestEventPaul Wicking2018-07-311-5/+2
| | | | | | | | | | | | | | | | | | | | QTestEventList refers to QTestEvent, which is an implementation detail that should not appear in documentation. Task-number: QTBUG-68109 Change-Id: Id132889427b757ea17165c8b15ed47bcfb9e1c3f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | testlib: Allow pausing the process on crashTor Arne Vestbø2018-07-311-2/+7
| | | | | | | | | | | | | | | | | | Makes it easier to run a test repeatedly until it crashes, and then attach a debugger. Change-Id: I8ad5d706becd77a2743a51927c837f3d1da08624 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | testlib: Move qtestsystem helpers to their respective modulesTor Arne Vestbø2018-07-164-227/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Having the helpers in each respective module lets us implement the helpers using private APIs without forcing the test to add private dependencies. It also makes it easier to test Qt using a third party testing framework (for running the test suite), while still using the helpers for ensuring tests behave expectedly. Change-Id: I2a6ce24526ed345f3513548f11da05c7804c203f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-023-10/+27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * QAbstractItemModelTester: don't call match(QModelIndex(), ...)David Faure2018-06-271-2/+3
| | | | | | | | | | | | | | | | | | The documentation for match() indicates that the index has to be valid since it determines which column to search in (in addition to "from which row"). So call match with a valid index, if the model isn't empty. Change-Id: I5f3754cf14d053bf04d207cefe7dcc938e0f4a5a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * QAbstractItemModelTester: fix out-of-bounds index() callsDavid Faure2018-06-271-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When removing rows, the tester is looking at the data of the row "just before" and the row "just after" the removed rows, to see if they are still the same at the end of the removal operation. Guard this with bounds check, in case there is no row just before or just after. This is the opportunity to use modeltester in tst_qidentityproxymodel, which was already a testcase for removing the only row in a given parent. Change-Id: Iec8228c16b9c670b794e2665356d153679178494 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * QAbstractItemModelTester: add missing includesDavid Faure2018-06-271-0/+2
| | | | | | | | | | | | | | | | The code (in macros) uses these classes, so the header should ensure they are defined. Change-Id: Ic68fa5559b7c0481927b47775b9cb7da12be7979 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
| * QtCore/QtNetwork/QTestlib: Fix build with MinGW/g++ 8.1 x64Friedemann Kleint2018-06-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings about invalid function type casts (return types conflicting with the FARPROC returned by GetProcAddress()) like: corelib\global\qoperatingsystemversion_win.cpp:100:48: error: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'RtlGetVersionFunction' {aka 'long int (*)(_OSVERSIONINFOW*)'} [-Werror=cast-function-type] io\qlockfile_win.cpp:158:85: error: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'GetModuleFileNameExFunc' {aka 'long unsigned int (*)(void*, HINSTANCE__*, wchar_t*, long unsigned int)'} [-Werror=cast-function-type] by introducing nested casts. Task-number: QTBUG-68742 Task-number: QTQAINFRA-2095 Change-Id: I3a5d2ea901bf5dc35963c589d61cf3dc7393377a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QFINDTESTDATA,Android: fix 'relative to test source'Mårten Nordheim2018-06-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-compiling for Android on Windows the 'relative to test source' option could end up possibly matching with a matching folder in root ('/') because file is a Windows path and the canonicalFilePath of that path is "". Fixes tst_qxmlstream (and possibly others) on Android when Qt is compiled on Windows. Task-number: QTBUG-68596 Change-Id: I378374e41eea80f43680b3941adaa91fa604934a Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-071-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Fix build for Android with android-clang in r17Liang Qi2018-06-061-2/+2
| | | | | | | | | | | | Task-number: QTBUG-67464 Change-Id: Ib971a5da82b31bce9ac1c9ac623ad7d5302cfaec Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | testlib: Mark unused member variable for future removalKari Oikarinen2018-06-051-4/+1
| | | | | | | | | | | | | | | | | | inLoop is only set, never read and it is private. Since the class is public, it can't be removed yet, but add a comment so that it will be removed when possible. Change-Id: I5e212194cb65626fce2b4c7b68801a73dbe3f500 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Improve std::tuple handling in testsSamuel Gaist2018-06-033-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently when doing comparison with std::tuple the fallback toString method is called which returns a Q_NULLPTR thus not allowing proper diagnostic of the values that triggered an error. This patch adds support for std::tuple to improve the tests output readability. [ChangeLog][QtTest][QCOMPARE] Now outputs contents of std::tuple on failure. Change-Id: I046a55e2ce44c3f7728d51e4745120d38aa5e007 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-241-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/corelib/tools/qstring.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/widgets/qmainwindowlayout_p.h Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
| * QtTest: compile in C++17 mode: no more std::unary_functionThiago Macieira2018-05-151-1/+1
| | | | | | | | | | Change-Id: I5d0ee9389a794d80983efffd152cbce4da448ddf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>