summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | 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.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.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>
* | 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
| | * 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>