summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-151-1/+1
| | |\ | | | | | | | | | | | | Change-Id: Id7954ada1f8658d3b1da5e8241a09f2d201a7c56
| | | * Bound the scope of QTRY_LOOP_IMPL()'s local variableEdward Welbourne2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTRY_IMPL() exercises QTRY_LOOP_IMPL() twice, once directly, the second time via QTRY_TIMEOUT_DEBUG_IMPL(); and QTRY_LOOP_IMPL() deliberately doesn't bound its scope (e.g. with the canonical do{...}while(0) trick) so that the latter can access its local variable. Unfortunately, this means the local's declaration in the second use of QTRY_LOOP_IMPL() shadows the first. So enclose the first in braces to bound the scope. Fixes: QTBUG-77297 Change-Id: I849bfe0b8abfb517ed3e783abf86c602163db137 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | | QTestLib: Introduce initMain() to run in main before qApp existsFriedemann Kleint2019-08-132-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running Qt autotests on a developer machine with a high resolution, failures occur due to either some widget becoming too small, some rounding fuzz appearing when Qt High DPI scaling is active, or some test taking screenshots failing to deal with device pixel ratios != 1 in the obtained pixmaps. It is not feasible to adapt all tests to pass on high resolution monitors in both modes (Qt High DPI scaling enabled/disabled). It should be possible to specify the High DPI setting per test. Previously, it was not possible to set the Qt High DPI scaling attributes since they must be applied before QApplication instantiation. Enable this by checking for the presence of a static void initMain() function on the test object and invoking it before QApplication instantiation. Prototypically use it in tst_qtimer and to turn off High DPI scaling for tst_QGL. [ChangeLog][QtTestLib] It is now possible to perform static initialization before QApplication instantiation by implementing a initMain() function in the test class. Change-Id: Idec0134b189710a14c41a451fa8445bc0c5b1cf3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Introduce QSignalSpy constructor allows to spy on a meta methodVitaly Fanaskov2019-08-133-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functionality is especially convenient if meta-object system is heavily used in a test. For example, if you need to test a bunch of signals based on their names and/or argument types. Change-Id: I09a4ecbbd3d0859b5fd466d9dde7679804eb7614 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | QSignalSpy: Extract object validation to a separate methodVitaly Fanaskov2019-08-131-6/+12
| | | | | | | | | | | | | | | | | | | | Change-Id: I167a01257cfdb679cb81861bfae26d8fa40f8c27 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | QSignalSpy: Extract meta signal validation to the separate methodVitaly Fanaskov2019-08-131-5/+12
| | | | | | | | | | | | | | | | | | | | Change-Id: I37a74ea4487a437646815d3117ec8b0fd7073205 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | QSignalSpy: Extract connection functionality into a separate methodVitaly Fanaskov2019-08-131-10/+16
| | | | | | | | | | | | | | | | | | | | Change-Id: Ie6406c79b070cba715250711578cd3d80c089559 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Lars Knoll2019-08-0636-250/+463
|\| | | | | | | | | | | | | | | Change-Id: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
| * | | QTest: add toString(QBitArray)Thiago Macieira2019-08-051-0/+11
| | | | | | | | | | | | | | | | | | | | Change-Id: Ife213d861bb14c1787e1fffd15b70598cda8baf3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QTestLib: Speed up QCOMPARE for QStringFriedemann Kleint2019-08-014-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add overloads for qCompare() for QStringView making use of the fast formatting helper introduced by 94aa350621e8a5c4ad3b438c10fc1c0a9ed3bc8a for int. Speeds up the bug report example by a factor of 3..4. Task-number: QTBUG-38890 Change-Id: Icc706618b2f1d23b37d354a04d4e1d1cc4b5aee3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QTestLib: Fix various clang warningsFriedemann Kleint2019-07-298-36/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix else after return/break - Fix use of int as boolean literal - Use range-based for in some cases - Avoid copies by using const-ref - Remove unnecessary null-check before delete Task-number: QTBUG-69413 Change-Id: I69f46e6deaa55ef70a8b3a61e6539c79a64aaa23 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Port from QStringViewLiteral to u""Marc Mutz2019-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all our supported compilers know char16_t, we no longer need QStringViewLiteral, whose only purpose in life was to turn u"" into L"" for MSVC < 2015. Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | QTestLib: Fix class declarations/structureFriedemann Kleint2019-07-1110-34/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove virtual from functions declared as override - Use " = default" for trivial constructors/destructors - Remove all special functions from QTestLog Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: I812b8116e5b4c927e4e5cee44e63bc705385d866 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | | QTestLib: Introduce nullptrFriedemann Kleint2019-07-1112-62/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: I620e40a277dc2b20b0ec26fc32577e66b0456bb3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | | QTestLib: Use member initializationFriedemann Kleint2019-07-1118-94/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: Iba0834dc89cbfc215acc5873f31fa6eeed74177d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | | Fix testlib build without features.propertiesTasuku Suzuki2019-07-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3ca7f8cdb59a9a1e61d2702e92cd5e2d1420ac84 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
| * | | QTestLib: Speed up QCOMPARE for float, double, int, unsignedFriedemann Kleint2019-07-094-22/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out a helper template formatting the QCOMPARE failure message delaying the formatting of the parameters with toString() and use that for float, double, int and unsigned. This removes the need to always format and allocate strings for the operands even in the success case, speeding up the QColor test from 3.3s to 700ms (Windows/release). Task-number: QTBUG-38890 Change-Id: I999484765bdaed921d3fc35f35a9fbbcd82a9704 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | QTestlib: Check compared images for device pixel ratioFriedemann Kleint2019-07-091-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When accidentally running a test doing screen-grabbing with High DPI scaling active, sizes of the obtained pixmaps can differ due to the device pixel ratio. Add a check to make that clearer. [ChangeLog][QtTestLib] Comparison of QImage, QPixmap now checks for the device pixel ratio. Change-Id: Id8d5187e99c565c44a7bfb8b9cfb09737815fb15 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-07-088-12/+18
|\| | | | | | | | | | | | | | | Change-Id: I02cbc4f77a82100b96cdb90c160ce0207f180d7f
| * | | Fix build without features.itemmodelTasuku Suzuki2019-07-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1235bed395a47438bc18571e2331a3432e274dec Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | | Fix qFindTestData() to work with relative resource pathsJan Arve Sæther2019-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the resource path 'base' was relative it would enter condition 3) in qFindTestData() and it would actually find the nonsensical "://data" as a viable candidate. We don't want to enter that case, but rather enter the subsequent ('Try resources') case Change-Id: I1928ba02c941e23fee4fec9052a1981e46fa59b7 Task-number: QTBUG-73512 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | | Testlib: Reset the global benchmark data only if it matchesUlf Hermann2019-07-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can create multiple instances of QBenchmarkGlobalData as the ctor is public. The qmltest plugin does create a static one, but only conditionally assigns it to the singleton pointer. On shutdown the plugin is removed and the QBenchmarkGlobalData::current should only be reset by the dtor if it's actually pointing to the same object. Change-Id: I616c1ccf6f7a00abf1de342094da88481510bc7b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | QTestLib: Replace typedef by 'using'Friedemann Kleint2019-06-294-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: I366cca6e5755719e8241e76774af6be2b5312627 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-272-1/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/network/ssl/qsslsocket_openssl.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
| | * | Add keyword msvc-2019 to testlib blacklistingHeikki Halmet2019-06-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ibb1d225909e6c0c8b35f3b41aeb619784012d43b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * | Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating .html page for each file in an example project, generate links to code.qt.io, under the correct path and branch, where the user can browse the example source. Store all URLs under QT_INSTALL_DOCS/config where other qt5 submodules can access them. The repository name appears in the URL, so we cannot define a single URL for all modules. Task-number: QTBUG-74391 Change-Id: I63d4d6d2c352877797b1ee8e057d48c0cd789bff Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Simon Hausmann2019-06-263-6/+38
|\| | | | | | | | | | | | | | | Change-Id: I4ea2b77cc201daed94fbe321f146dfd20365a534
| * | | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-202-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-0/+32
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| | * | doc: Add dontdocument.qdoc filesMartin Smith2019-05-071-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each module that has publically declared classes or structs that are not meant to be documented is given a dontdocument.qdoc file to tell qdoc that these classes are not meant to be documentented. Then qdoc will not print warnings about missing \class comments for these classes and structs. Change-Id: I9195f0b546032e1c7642c9da34d85a0a4a9bfb08 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-06-111-12/+12
|\| | | | | | | | | | | | | | | Change-Id: Ieb8efee9d74229b9f141ec715e3a9557586b51e8
| * | | Remove QLatin1Literal usagesGiuseppe D'Angelo2019-06-101-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That's an undocumented Qt 4/3/2 remnant, start remove usages. Fix incorrect include header in qclass_lib_map.h as a drive-by. Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-06-067-20/+23
|\| | | | | | | | | | | | | | | Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
| * | | Replace QTESTLIB_USE_VALGRIND with a new feature 'valgrind'Tasuku Suzuki2019-05-287-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I851788cb1872eef86c75c7bdb2de361a0ff2af6c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | | | Bump version to Qt 6Lars Knoll2019-05-141-0/+10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed to disable QT_NO_UNSHARABLE_CONTAINERS, as this triggers asserts. QMetaType also has some Qt 6 specific code disabled to get things to compile. Fix various details in autotests to accommodate for the changes with Qt 6. Add a workaround for black lists on macos, where QSysInfo::productType() now returns 'macos' and not 'osx' anymore. Change-Id: Ie26afb12a2aac36521472715934a7e34639ea4d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QtTestLib: handle float16 the same as double and floatEdward Welbourne2019-04-241-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QCOMPARE, handle NaNs and infinities the way tests want them handled, rather than by strict IEEE rules. In particular, if a test expects NaN, this lets it treat that just like any other expected value, despite NaN != NaN as float16 values. Likewise, format infinities and NaNs specially in toString() so that they're reported consistently. Enable the qfloat16 tests that depend on this QCOMPARE() behavior. Refise the testlib selftest's float test to test qfloat16 the same way it tests float and double (and format the test the same way). This is a follow-up to 37f617c405a. Change-Id: I433256a09b1657e6725d68d07c5f80d805bf586a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-101-9/+9
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/gui/image/qpnghandler.cpp Change-Id: Ied79d02912ffb3a307a99483df7db08c7f9d0cd8
| * | QBenchmarkValgrindUtils: port to QRegularExpressionSamuel Gaist2019-04-091-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the code from the deprecated QRegExp class to QRegularExpression. Task-number: QTBUG-25485 Change-Id: I946790f50c6b14787bca31771de5e3a0d5fefe4c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Optimize QTimer::singleShot(0, ...) when taking PMF or Functor callableMilian Wolff2019-04-061-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTimer::singleShot is optimized for zero timeouts when using the API taking a string method name. This optimization was not used for the API taking a PMF or functor. This patch adds it, making the various API calls behave similarly from a performance point of view. The approach taken here requires a QObject context object. If none is available, e.g. a nullptr was passed explicitly, or the QTimer::singleShot(O, Functor) API was used, the optimization could not easily be applied. This is not only bad from a performance POV, but also poses as a potential source for heisenbugs: Using the different API versions of QTimer::singleShot would use different code paths internally, which then would not ensure the expected slot call order. This problem actually existed already when mixing the string-based slot syntax with PMF/functors in the QTimer::singleShot API. This patch overcomes this hurdle and fixes all of the above: When we encounter a 0ms single shot timer, and no QObject context object is available, we fall back to the main thread, or create a temporary QObject for any other thread. The updated and extended benchmark shows that this is still a significant performance improvement over using a timer: ********* Start testing of qtimer_vs_qmetaobject ********* Config: Using QtTest library 5.14.0, Qt 5.14.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127) PASS : qtimer_vs_qmetaobject::initTestCase() PASS : qtimer_vs_qmetaobject::bench(singleShot_slot) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot": 7.48 msecs per iteration (total: 748, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(singleShot_pmf) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf": 7.20 msecs per iteration (total: 720, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(singleShot_functor) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor": 6.79 msecs per iteration (total: 679, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx": 6.92 msecs per iteration (total: 693, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(invokeMethod_string) RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string": 7.34 msecs per iteration (total: 735, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(invokeMethod_pmf) RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf": 6.90 msecs per iteration (total: 690, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(invokeMethod_functor) RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor": 6.62 msecs per iteration (total: 662, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_slot) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_slot": 7.45 msecs per iteration (total: 745, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_pmf) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_pmf": 7.46 msecs per iteration (total: 747, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor": 6.70 msecs per iteration (total: 671, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor_noctx) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor_noctx": 13.75 msecs per iteration (total: 1,376, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_string) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_string": 7.05 msecs per iteration (total: 706, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_pmf) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_pmf": 6.70 msecs per iteration (total: 670, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_functor) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_functor": 6.58 msecs per iteration (total: 658, iterations: 100) PASS : qtimer_vs_qmetaobject::cleanupTestCase() Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 20977ms ********* Finished testing of qtimer_vs_qmetaobject ********* Without the change to qtimer.cpp, the results are: ********* Start testing of qtimer_vs_qmetaobject ********* Config: Using QtTest library 5.14.0, Qt 5.14.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127) PASS : qtimer_vs_qmetaobject::initTestCase() PASS : qtimer_vs_qmetaobject::bench(singleShot_slot) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot": 7.45 msecs per iteration (total: 745, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(singleShot_pmf) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf": 112.84 msecs per iteration (total: 11,285, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(singleShot_functor) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor": 115.62 msecs per iteration (total: 11,563, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx) RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx": 110.81 msecs per iteration (total: 11,082, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(invokeMethod_string) RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string": 7.04 msecs per iteration (total: 704, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(invokeMethod_pmf) RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf": 6.62 msecs per iteration (total: 662, iterations: 100) PASS : qtimer_vs_qmetaobject::bench(invokeMethod_functor) RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor": 6.62 msecs per iteration (total: 662, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_slot) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_slot": 7.45 msecs per iteration (total: 746, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_pmf) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_pmf": 118.42 msecs per iteration (total: 11,842, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor": 119.35 msecs per iteration (total: 11,936, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor_noctx) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor_noctx": 130.96 msecs per iteration (total: 13,096, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_string) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_string": 8.08 msecs per iteration (total: 808, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_pmf) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_pmf": 6.79 msecs per iteration (total: 680, iterations: 100) PASS : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_functor) RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_functor": 7.49 msecs per iteration (total: 749, iterations: 100) PASS : qtimer_vs_qmetaobject::cleanupTestCase() Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 153995ms ********* Finished testing of qtimer_vs_qmetaobject ********* Additionally, this patch adds a unit test to verify that the slot call order for 0ms single shot timers is followed while mixing the various API versions. It fails without this patch but passes now. Finally, another test is added to verify that using QTimer::singleShot before a QCoreApplication was constructed is still working properly. Change-Id: I0d6211554b6198cb3e527be9ec3adc572b1b54ee Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove handling of missing very old compiler feature checkAllan Sandfeld Jensen2019-04-061-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes handling of missing Q_COMPILER_NULLPTR, Q_COMPILER_AUTODECL, Q_COMPILER_LAMBDA, Q_COMPILER_VARIADIC_MACROS and Q_COMPILER_AUTO_FUNCTION. We haven't supported any compilers without these for a long time. Change-Id: I3df88206516a25763e2c28b083733780f35a8764 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Replace qMove with std::moveAllan Sandfeld Jensen2019-04-062-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-312-39/+98
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-272-39/+98
| |\| | | | | | | | | | Change-Id: Ia3591d7288bac3bf441f27e486d35e2c5c481993
| | * Apple test logger: Handle test log messages without a contextTor Arne Vestbø2019-03-262-39/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We may get calls to the MessageTypes-overload of addMessage via e.g. qSkip, or other functions in QTestLog, so we have to implement the function. Change-Id: I9d58c73e93ca918c42448c246c37cc9ae6aa04de Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Fix the skip-check in TestMethods::invokeTest()Edward Welbourne2019-03-291-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TestMethods::invokeTest() has an outer loop on global data (albeit with a comment that said otherwise). On its first cycle, we run the test function's *_data() method, if it has one; there is an inner loop on the rows this created. If the *_data() QSKIP()s, we need to skip the whole test; otherwise, a QSKIP() in one sub-test should not lead to skipping the remaining sub-tests. Moved the check for *_data() QSKIP()ping to right after *_data() returns, inside the "first global cycle" block that runs it. Previously, this check was done before entering the loop on local data rows, but outside that "first global cycle" block: consequently, later global cycles would fall foul of this check (even though the *_data() hasn't been run in this cycle, much less QSKIP()ped in it) if the last sub-test of the previous global cycle had QSKIP()ped. When running a single test for one specific data row, if the test's *_data() QSKIP()ped, this misplaced check would also have lead to a misleading "Unknown testdata" warning. Changed testlib/selftests' tst_globaldata::skipSingle() to trigger the bug (by having its last local row of first global row skip, which caused the second global row to be omitted) to verify this is also fixed; and amended one of its comments to reflect what's now to be expected. Updated the test's expected output files. Task-number: QTBUG-61774 Change-Id: I99596b595c6d1184038f23383844c6ff51a0cd91 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Test QTest's signal dumperMårten Nordheim2019-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | It has been completely untested for a while and saw some breakage. So let's add a selftest for it. ('-vs' when running tests) Change-Id: Ibfb5ac0a2d741de7c3f519d91202d4977996045e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Widen out parameter "result" of the native event filters for Qt 6Friedemann Kleint2019-03-222-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | LRESULT on Windows 64 is a 64bit type, adapt filter functions of QAbstractNativeEventFilter and QAbstractEventDispatcher accordingly. Fixes: QTBUG-72968 Change-Id: Ie53193e355f0b8e9bd59fa377f43e2b4664a2ded Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add qFpClassify() to mirror std::fpclassify()Edward Welbourne2019-03-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rules of std don't permit us to add an overload for fpclassify(qfloat16), so we need our own equivalent that we *can* overload. Deploy it in the few places we use fpclassify(). Extended qnumeric's testing to cover qFpClassify(). Change-Id: Ie5a0a5cc24599d1571404c573d33c682b0d305a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | More nullptr usage in headersKevin Funk2019-03-1410-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-095-186/+131
|\| | | | | | | | | | | Change-Id: I056b658ffe9390dfcbe2787e2bddc7f4e9b389dd