summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | 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
| * | Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into ↵Liang Qi2019-03-065-172/+102
| |\ \ | | | | | | | | | | | | refs/staging/5.13
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-03-065-172/+102
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/http2/hpacktable_p.h Change-Id: Ie0c296667dfdebba84f4858056a1ac80c24ee7df
| | | * testlib: Prevent Apple test logger from stomping on other loggersTor Arne Vestbø2019-03-055-43/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were potentially adding the Apple test logger multiple times, and we didn't consider whether the existing loggers were logging to file or not when circumventing them. We now don't use the Apple logger if it would touch stderr and some other logger is using stdout. In the case of no explicit logger being specified on the command line, we allow the Apple logger to take priority over the default plain test logger. Change-Id: I31bbec4f4b3ab84ba9a2be35e8e5db08fee071a7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | * testlib: Replace manual logger linked list with QVectorTor Arne Vestbø2019-03-051-129/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes useless indirection and builds on existing primitives in Qt. Change-Id: I9fe50b21f5f77fc02566d5f5ff04c3e94c830e81 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Minor cleanup of QTest::qFindTestDataOliver Wolff2019-03-061-14/+29
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | - braces on same line as else where applicable - const where possible - Same extended logging format for all cases Change-Id: If0c91f270ce2a9be1d295f42a915900f3b1838cf Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QtTestLib: unify handling of float and double using suitable templatesEdward Welbourne2019-03-041-22/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QTest::qCompare() implementations were almost duplicates; pull the common code out into a templated version. Tweaked the QTest::toString() specialization for float and double (a macro) and fixed a bous modifier in double's format. The doubleComparisons and floatComparisons tests in the tst_float.cpp selftest shared a large block of tests in common, aside from the difference of type. Break this out into a templated static function to save duplication. This prepares the way for using the same templated code for qfloat16. Change-Id: I2823fd006910c5ff88335d625d1fa05cb7753513 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-272-1/+5
|\| | | | | | | | | | | Change-Id: I14eaabe98845445a9ea5266872cc1797786cfe04
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-261-0/+4
| |\| | | | | | | | | | Change-Id: Id511850002d9274d17891c063376ac4b3ff939dd
| | * qtlite: Fix build the source code with -no-feature-shortcutMikhail Svetkin2019-02-251-0/+4
| | | | | | | | | | | | | | | Change-Id: If47149466a5da901e3eb6e6f2dcfb0a7816bc60b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * | Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | | | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-223-2/+5
|\| | | | | | | | | | | Change-Id: I4b56ce8c76729d9fc60995564299f8f27336fcde
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-221-0/+1
| |\| | | | | | | | | | Change-Id: I9e7cb1b131b7b216aad8ed1b1536669fd1557c21
| | * Add keyword "macos" to testlib blacklistingTony Sarajärvi2019-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With "macos" keyword in place, we can blacklist using that keyword instead of the old "osx". Change-Id: Ib7a2f88265271df152320cce8594b8f788b47687 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-211-0/+2
| |\| | | | | | | | | | Change-Id: I830beea26863323ab78a5d4b093f7763d77ad3da
| | * Add missing increment of blacklisted tests for BXFAIL caseEdward Welbourne2019-02-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The counter is just how many tests were blacklisted, regardless of their success or otherwise. Skipping its increment for BXFAIL is apt to introduce noise in our tracking of how many tests are blacklisted. Change-Id: I1dd74e5f6619121c21d8741be7bc4e2d1cb43fa9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * | QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentationChristian Ehrlicher2019-02-201-2/+2
| | | | | | | | | | | | | | | | | | | | | Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: I58934eea06943309ba895833f1991629870ab45b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-2011-13/+125
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp Added tests/auto/testlib/selftests/expected_crashes_5.txt to work round the output of the crashes test (which exercises UB, see QTBUG-73903) being truncated on one test platform. Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-0811-13/+125
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
| | * Add testlib selftests for double and for non-finite float and doubleEdward Welbourne2019-02-061-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tidied up the existing float tests in the process. (In particular, s/SUCCESS/PASS/ since that matches real test output.) These verify that QCOMPARE() handles floats and doubles as intended. Extended the existing qFuzzyCompare tests to probe the boundaries of the ranges of values of both types, in the process. Revised the toString<double> that qCompare() uses to give enough precision to actually show some of the differences being tested there (12 digits, to match what qFuzzyCompare tests, so as to show different values rather than, e.g. 1e12 for both expected and actual) and to give consistent results for infinities and NaN (MinGW had eccentric versions for these, leading to different output from tests, which thus failed); did the latter also for toString<float> and fixed stray zeros in MinGW's exponents (which made a kludge in tst_selftest.cpp redundant, so I removed that, too). That's further complicated handling of floating-point types, so let's just keep an eye on how expensive that's getting by adding a benchmark test for QTest::toString(). Unfortunately, default settings only get runs that take modest numbers of milliseconds (some as low as 40) while increasing this with -minumumvalue 100 or more gets the process killed - and I'm unable to find out who's doing the killing (it's not QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell). So results are rather noisy; the integral tests exhibit speed-ups by factors up to 5, and slow-downs by factors up to 100, between runs with and without this change, which does not affec the integral tests. The relatively modest slow-downs and speed-ups in the floating point tests thus seem likely to be happenstance rather than signal. Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * testlib: Add BXPASS and BXFAILOliver Wolff2019-01-2910-9/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prioritize blacklisting over QEXPECT_FAIL so that a test that is blacklisted no longer fails if QEXPECT_FAIL returns true unexpectedly. To reflect this state properly, the two values of BXPASS and BXFAIL were added to testlib's output. [ChangeLog][Important Behavior Changes][QtTestLib] Blacklisting of tests will be taken into account for XPASS and XFAIL. A blacklisted test that causes an XPASS will no longer be a fail. Task-number: QTBUG-72928 Change-Id: Ia2232fdc714d405fa3fd9aea6c89eb2836bc5950 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * qtlite: Fix build libs with -no-feature-regularexpressionMikhail Svetkin2019-01-271-1/+10
| | | | | | | | | | | | | | | Change-Id: I427ff1f8f4986fbf466aba60a9d3de614c1e006f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Shave ~5% off from signal emission timeLars Knoll2019-02-081-3/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor activate(), so that we eliminate almost all checks for signal hooks in the common case. Here are the benchmark numbers showing the improvement for 100M signal emissions without change with change string based connect: 3836 3693 pointer based connect: 4571 4510 not connected: 479 433 disconnected: 559 522 Change-Id: I394e6ea5d5bc96e298e8cc0c763eed78c8041876 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-266-7/+101
|\| | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
| * testlib: Format durations using C localeTor Arne Vestbø2019-01-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | XML expects '.' as the decimal separator, but when using normal %f formatting we end up depending on the user's current locale. By using QString::number() we tap into qt_doubleToAscii which forces the use of the C locale, giving predictable output. Fixes: QTBUG-73227 Change-Id: I04d1adae2ef079442605e962007e5ce3fce896b7 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-235-3/+96
| |\ | | | | | | | | | Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
| | * Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-081-20/+31
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
| | * | Doc: Restore documentation for QTest functions in other modulesTopi Reinio2019-01-043-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Test library sources specific to Core, GUI and Widgets modules were moved around in commit 88867e39b. The new source locations must be referenced in Qt Test documentation configuration. The same sources are excluded in their original doc projects, and the related snippet file is moved over to qttestlib. The commit also fixes the remaining documentation issues for Qt Test. Change-Id: Ibe011aa83639e574d647f12bc9e53e618781bce6 Reviewed-by: Martin Smith <martin.smith@qt.io>
| | * | Doc: Fix linking errors qtbaseNico Vertriest2019-01-032-3/+3
| | |/ | | | | | | | | | | | | Change-Id: I225e59bea0a8eac14fd11ef2b091907ae955c447 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Add a feature to enable CodeCoverage analysis of testlibEdward Welbourne2019-01-246-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on Asmo Saarela's advice (QTPM-686), adapted on advice from FrogLogic support and converted to a feature so that the selftest and testlib qmake config can be co-ordinated. Task-number: QTPM-1385 Change-Id: Icd706f086009e1e08b3f8c5cd553f792402e28c0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-212-2/+17
|\| | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * | testlib: Add missing header files to .pro fileOliver Wolff2019-01-151-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | With all the headers missing, Creator's clang code model just gives up and it's impossible to work on testlib in Creator. Change-Id: I8814264db10992eeec6f45625580f6788d23b56b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Documentation: Add \nullptr macro and use where applicableFriedemann Kleint2019-01-101-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QtTest: add toString(QModelIndex)Christian Ehrlicher2018-12-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | Add toString(QModelIndex) to make debugging itemmodels/views autotests easier. [ChangeLog][QtTest] Added QTest::toString(const QModelIndex &idx) Change-Id: I20ad6b1fb145c00a3239131a3274fdbefc3b3ffd Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | 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