summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
Commit message (Collapse)AuthorAgeFilesLines
* QTestLib: Introduce initMain() to run in main before qApp existsFriedemann Kleint2019-08-133-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-0/+52
| | | | | | | | | 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>
* QTestlib: Check compared images for device pixel ratioFriedemann Kleint2019-07-097-61/+135
| | | | | | | | | | | | | 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>
* Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-141-1/+2
| | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* test: migrate QAbstractItemModelTester to QRegularExpressionSamuel Gaist2019-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. Task-number: QTBUG-72587 Change-Id: I23bc9693fb9f553fd63d10687d51322394717ed7 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-137-6/+38
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-097-6/+38
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Fix integer overflows in QDeadlineTimerKonstantin Shegunov2019-05-087-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the deadline is far in the future, the conversions to nanoseconds or internal arithmetic may overflow and give an invalid object, thus the deadline may end up in the past. Added a test to the testlib selftest for sleep. [ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows leading to immediate timeouts. Task-number: QTBUG-69750 Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QtTestLib: handle float16 the same as double and floatEdward Welbourne2019-04-247-52/+1048
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Replace Q_DECL_NOTHROW with noexcept the remaining placesAllan Sandfeld Jensen2019-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first replacement had missed objective-C++ code some places ourside the src dir. In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still need to turn it off when compiled in C mode, but can get rid of the old NOTHROW moniker. Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Qt Forward Merge Bot2019-04-0418-315/+2655
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Fix the skip-check in TestMethods::invokeTest()Edward Welbourne2019-03-297-33/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Tidy up tst_globaldata to use better namings and document what it testsEdward Welbourne2019-03-277-299/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, document the mis-behavior it takes for granted in one test. Renamed some variables so that they're visually distinct from one another and actually mean something intelligible. Renamed the sub-tests to say what's actually happening. Reading the test output now at least makes it possible to see what's wrong. I'll fix that in a later commit. Task-number: QTBUG-61774 Change-Id: I3e5f83b8baa3c6afbca9231b5bbc89d17f3e57e2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * | | Test QTest's signal dumperMårten Nordheim2019-03-2711-0/+2270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Remove commented test in testlib (alive)Jędrzej Nowacki2019-03-296-244/+0
|/ / / | | | | | | | | | | | | | | | | | | The test was added as commented in 2012, before it was not even mentioned in the pro file. I guess it was never run. Change-Id: Ib787c7811ab4f7f32a99869167cde2e12dbe3156
* | | QtTestLib: unify handling of float and double using suitable templatesEdward Welbourne2019-03-046-239/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2022-119/+2516
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0822-119/+2553
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-068-81/+2316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Add some missing expected_*.tap files for the testlib selftestEdward Welbourne2019-02-017-0/+248
| | | | | | | | | | | | | | | | | | | | | | | | Only for tests that have existing expected_*.* files for other formats, though. Change-Id: I34ca1900d88454f300e04d849a608c378009489b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * generate_expected_output.py: placate FutureWarning from pythonEdward Welbourne2019-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regexes have long specified that a [ as the first character inside a [...] is just a literal [, but apparently we need to escape it now, to avoid a "nested set" FutureWarning. Change-Id: I76a48c9aafb0684a1d6b0d5284fe9852c9ea0e43 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
| | * testlib: Add BXPASS and BXFAILOliver Wolff2019-01-296-24/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Dodge qFatal() so as to get coverage results despite itEdward Welbourne2019-02-113-2/+82
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The silent and blacklisted selftests of testlib end in a qFatal(), to test its messaging is handled correctly. However, this prevents hooks in main() from saving coverage data when we're gathering that. So use a transient signal handler that longjmp()s back to a setjmp() just before the qFatal() to let the test complete normally (but, since qFatal() does something different on MS-Win, don't apply this to it). Note that testlib's internal FatalSignalHandler handles all fatal signals *except* SIGABRT, so this isn't over-riding it. (In any case, this restores the prior signal handler in setjmp()'s catch branch.) Added missing expected_silent.tap test output while checking that this change doesn't affect (the rest of) the test output. Change-Id: I7e460581ad93e26639c066b3229438a66fd299de Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Fix inline ASM to use local labels for jump operationsDaniel Smith2019-01-251-2/+2
| | | | | | | | | | | | | | | | | | Non-local ASM labels break for this test when compiled with clang. Change-Id: I15bd250a991c3b03bbc88459a6358090bd157444 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Add a feature to enable CodeCoverage analysis of testlibEdward Welbourne2019-01-2456-0/+111
| | | | | | | | | | | | | | | | | | | | 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>
* | Add assorted tests to exercise more QTest functionsEdward Welbourne2019-01-2410-0/+275
| | | | | | | | | | | | | | | | | | Coverage analysis reveals some unexercised code. Task-number: QTPM-1385 Change-Id: Ib3fdbcf778e7af14ca6dfa1a11bcb4943276de69 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-215-12/+12
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * Eliminate some stray misleading paths from expected output filesEdward Welbourne2019-01-165-12/+12
| | | | | | | | | | | | | | | | | | The output files for the tuplediagnostics selftest of testlib had a stray non-canoical path fragment in them; so replaced with its canonical form. Change-Id: Ib421380036c3fb1b91447eb8c87be4ad0dfe5c96 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Add a testlib selftest for the watchdogEdward Welbourne2018-12-0611-4/+165
| | | | | | | | | | | | | | | | Verify that it does cut in after the specified time has elapsed. Task-number: QTPM-1385 Change-Id: Ib18e8d6af28339f79cca4d62b869287ce07b8cc1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | generate_expected_output.py: refine environment used for subtestsEdward Welbourne2018-12-061-26/+64
| | | | | | | | | | | | | | | | | | Match the environment tst_selftests.cpp uses for subtests more faithfully. Extends b22e50acda. In the process, tweak how crashers are handling, in preparation for the watchdog test. Change-Id: I09a046460f6f3bff0b12069fad6c1437d89572ce Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Test that mismatches of datatype in test data columns are rejectedEdward Welbourne2018-12-0621-10/+347
| | | | | | | | | | | | | | | | | | | | One test for bad data for the column, another for a bad QFETCH. Incidentally extend blacklist testing by blacklisting them. Reorganise a QEMU condition that needed extended as part of this. Task-number: QTPM-1385 Change-Id: Iac72ada19760321c5c9264ddfff7740d1fdd0700 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-041-0/+3
|\| | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
| * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-11-271-0/+3
| |\ | | | | | | | | | Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
| | * Make developer build tests pass for boot2qtSami Nurmenniemi2018-11-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Some tests were fixed and others were skipped/blacklisted. Task-number: QTBUG-63152 Change-Id: Ica7df555f8d152ee589865911130525101d4b941 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Add qfloat16 support to QCOMPAREAllan Sandfeld Jensen2018-11-207-22/+191
| | | | | | | | | | | | | | | | | | Change-Id: Ide06f215a888328308a06e7e48edd666f790a5f0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-131-3/+0
|\| | | | | | | | | | | Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
| * | macOS: Remove blacklist entries for no longer supported OS versionsTor Arne Vestbø2018-11-121-3/+0
| | | | | | | | | | | | | | | Change-Id: Iae6552f1fdcf1dea07a03d3788d378af9140d1a7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | QTreeWidget: mark (is|set)Item(Selected|Hidden|Expanded) as deprecatedChristian Ehrlicher2018-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeWidget::(is|set)Item(Selected|Hidden|Expanded)() are deprecated for a long time but not marked as such. Therefore explicitly mark them as deprecated so they can get removed with Qt6. Change-Id: Ie4971350de61326811e0788df0d359ed3c442869 Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Test and document QTest::toHexRepresentation()Edward Welbourne2018-11-083-3/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QTreeView/TableView: explicitly mark sortByColumn(int) as deprecatedChristian Ehrlicher2018-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeView/TableView::sortByColumn(int) was deprecated a long time ago but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13) so we can remove it with Qt6. Also sync the handling of the sort order changes in QTableView with the one from QTreeView. Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Tweak a selftest blacklist to exercise more of the blacklisting codeEdward Welbourne2018-11-018-11/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the process, corrected an inaccurate XFAIL message (an XPASS is normally an error, unless blacklisting ignores it so turns it into a BPASS). Added the missing .tap file to its expected output. Documented the similarity to the silent/ selftest. Task-number: QTPM-1385 Change-Id: Id74a1353d54af2f3bfe2c764e33c1f051958ab21 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | generate_expected_output.py: match tst_selftest's test environmentsEdward Welbourne2018-11-012-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | The testlib selftest sets various things in the environment for crashing tests; the generator for its expected output should set the same things, as they affect what output is produced. Change-Id: Iec2ed59982ea1043582573530c33619d8e8ed08e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | Simplify tst_Selftests::compareLine by handling the trivial case firstEdward Welbourne2018-11-011-7/+7
|/ / | | | | | | | | | | | | | | | | If the two lines have identical texts, the comparison returns true. So don't complicate various other conditions on the way there with filtering out that case; deal with it first so they don't need to. Change-Id: Iebd230704ce5f53d12d5afa64aab30f83bb9d407 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Fix building tests with -no-guiJüri Valdmann2018-10-201-2/+4
| | | | | | | | | | Change-Id: I37307080e5adc334fcfcdd2fee650d675228a746 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-022-1/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Make tests compile for AndroidLiang Qi2018-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only enables compilation, it doesn't fix any test. Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also acdd57cb for winrt. android-ndk-r10e is used to compile, see http://doc-snapshots.qt.io/qt5-5.11/androidgs.html . corelib/io/{qdir,qresourceengine} need to be fixed later. Done-with: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * findtestdata: test 'relative to test source'-fixMårten Nordheim2018-06-221-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the fix is applied this test fails because QFINDTESTDATA will return "/usr/" instead of the folder with the same name in the current directory. The 'usr' folder can't be located 'next to' the application since this does not trigger the issue (QFINDTESTDATA looks for the folder next to the executable early on). So we put it in a subdirectory and change the current working directory to its parent directory. Change-Id: I627679dcb6f2f6954264e23bfc1a71de3bff7203 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Improve std::tuple handling in testsSamuel Gaist2018-06-0310-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove mention of selftest.qrc from generator script's docEdward Welbourne2018-05-081-3/+1
| | | | | | | | | | | | | | | | This supplements b1945604a78626ed25ad8afe70a64c2eac76a2b4, which removed the qrc file in favor of test/test.pro coding for it. Change-Id: I15507c89ca14fa6e6b8223de671ffff7092272d0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Fix order of mouse selftest in selftests.priMitch Curtis2018-05-071-2/+2
| | | | | | | | | | | | | | | | Put it in alphabetical order like the rest of the list. Change-Id: I3da3bb68d1847f53419bb79490b946c935ebb518 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>