summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Use UTF-8 in the QtTest data and benchmark tagsThiago Macieira2012-06-093-4/+4
| | | | | | | | | | | Future-proofing. Since Qt source code is now mandated to be in UTF-8, it is entirely possible that someone will use non-ASCII in data tags. Though it would be interesting to see how to access them from the Windows command-line. Change-Id: I880fc312432b62143888ff1e1d9abbd54f704601 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use variadic macros where available to make QSKIP source compatible.Stephen Kelly2012-06-081-1/+11
| | | | | | | | | Otherwise this is a large source incompatbility during porting, so it makes sense to provide the option of using C++11 for that. Change-Id: I9792b3ae2c1fa3743bc9a2e74380134ea2f24add Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change testlib signal dumper hooks to use signal index rangeKent Hansen2012-06-042-17/+6
| | | | | | | | | | | | Another step towards getting rid of the class method offset computation in QMetaObject::activate(). Since QMetaObjectPrivate::signal() is private API, this also required adding a testlib dependency on core-private (and getting rid of the duplicated QSignalSpyCallbackSet struct). Change-Id: I0d830f35392a6b44fc321c5285877ec0bf437100 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make qWaitForWindowShown more robust on XLaszlo Agocs2012-05-291-0/+14
| | | | | | | Try ensuring the window has received its valid position from the WM. Change-Id: Ibd75bc19ae820765bfaadd30c22e77a19cd28849 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Replace `const QLatin1String &` with `QLatin1String` where appropriateKonstantin Ritt2012-05-251-1/+1
| | | | | | | Task-Id: QTBUG-24502 Change-Id: I360dee4dc68c165de0631ce4cf34e76fd873080e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QIcon: move back to QtGuiOlivier Goffart2012-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the files and tests git mv src/widgets/kernel/qicon* qrc/gui/image/ git mv tests/auto/widgets/kernel/qicon/ tests/auto/gui/image/ - update the include of QIcon git grep -O"sed -i s,QtWidgets/qicon,QtGui/qicon," "QtWidgets/qicon" git grep -O"sed -i s,QtWidgets/QIcon,QtGui/QIcon," "QtWidgets/QIcon" - Adapt QIcon \ingroup documentation sed -i s/QtWidgets/QtGui/ src/gui/images/qicon* - Adapt export macro sed -i s/Q_WIDGETS_EXPORT/Q_GUI_EXPORT/g src/gui/image/qicon* - Update .pri and .pro files - Remove the use of QStyle::alignedRect by copying its content (and adapt slightly - Use QGuiApplication::palette() instead of QApplication::palette() - Add a hook in QGuiApplicationPrivate to call the QStyle::generatedIconPixmap() from QtWidgets Another commit follows to adjust QMetaType::Icon and move the QVariant and QMetaType icon handler back in QtGui Change-Id: I1b63759f892ebc02dfc30f41bb6e76e0b7451182 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* testlib: added missing newline to error messageRohan McGovern2012-05-171-1/+1
| | | | | Change-Id: I8b205da4d225d99f8505a46d8d78ad302cb2b9e3 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* turn off exceptions by default where they aren't requiredLars Knoll2012-05-171-1/+1
| | | | | | | | | | | | | This significantly reduces the size of the generated code in places where we don't need exceptions. The -(no-)exceptions configure flag has been removed in the process, as there is now a fine grained way to control this on a per module level, and Qt is being compiled without exceptions in most places. Change-Id: I99a15c5d03339db1fbffd4987935d0d671cdbc32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add header qtest_widgets.h, similar to qtest_gui.h, but for QApplication.David Faure2012-05-161-0/+61
| | | | | | | | | | | | The current alternative is to define QT_WIDGETS_LIB before including qtest.h, but this is not convenient/intuitive when using other build systems than qmake. If one forgets the define, crashes happen when using QApplication-related code. Use <QTestWidgets> in one of the widgets autotests, for testing. Change-Id: Id96be4976723aea3e8a28c9d0d594daab25a6d90 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Doc: Add a default license footer.Casper van Donderen2012-05-111-0/+1
| | | | | | | | The CSS for the footer is not completely correct, but at this time it is better to have something than nothing. Change-Id: I7371e1e458a2abafcdb0fca5564ad73e209d64c3 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Fix -Wlogical-op warning in qtestmouse.hDavid Faure2012-05-111-2/+0
| | | | | | | | | | error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] Indeed these asserts do not test anything, given that MouseButtonMask is 0xffffffff Change-Id: I33cf59d3e77d9c644fc307de36f4e0ab1bea80f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change to/fromAscii to to/fromUtf8 in the QString conversionsThiago Macieira2012-05-111-1/+1
| | | | | | | | | | | This commit matches the previous documentation commit that says that the conversions are applied using to/fromUtf8. Change-Id: I304e4d866ddedac5094fef8500cbeba299a02cb5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't add C-style copyright headers to qmake project filesMarius Storm-Olsen2012-05-102-80/+0
| | | | | | | | Leads to parse errors, and we don't really put copyrights into these files anyways. Change-Id: I4b423b3f4f5c4f1f5051d8e3613133c4f1df342a Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Add "make docs" targets for libraries.Casper van Donderen2012-05-091-0/+3
| | | | | Change-Id: I249c238f4986f443f84aaa6a3ac4ce102abff4db Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Doc: Modularize QtTest documentation.Casper van Donderen2012-05-0914-33/+1709
| | | | | | | This change moves the snippets to the modularized directories. Change-Id: I917dd1dae5ee5d4b6bd5a0390783a8b9a99edc06 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtTest]Thiago Macieira2012-05-042-3/+3
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I6f3fa6a06ed037f3a98387958ba7ab18c3e04977 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Replace QGuiApplication::activeWindow by focusWindow().Friedemann Kleint2012-04-271-1/+1
| | | | | | | Fix deprecation warnings. Change-Id: I8d33aa8c035df6f5ef3fff6a402e980e43e03406 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Update QTest::QTouchEventSequence docsLaszlo Agocs2012-04-251-4/+74
| | | | | Change-Id: I2a8f88929f985b1543ec7c223266e8387f0a8a48 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Add flag in testlib to disable committing the simulated touchLaszlo Agocs2012-04-241-13/+18
| | | | | | | | Some declarative tests (e.g. 24319) need more fine-grained control over processing the simulated touch events. Change-Id: Ib163cfd29254016ea16e8d739ad97369b6ccdc90 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Don't use the QRegExp methods that modify the object [QtTest]Thiago Macieira2012-04-241-3/+3
| | | | | | | | | | | | | | QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: I7c5f5ebf4521c32337c9ea9aeeef50e1e8690bf8 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Add missing private headers to testlib.proThiago Macieira2012-04-231-0/+5
| | | | | Change-Id: Id927b05374b9e82fbee029258f176223b8b32e90 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Change coreservices -> iosIan Dean2012-04-191-1/+1
| | | | | | | | Replace "contains(QT_CONFIG, coreservices)" with "!ios" in config files. Replace "QT_NO_CORESERVICES" with "Q_OS_IOS" in source files. Change-Id: Id3b02316b245a24ce550e0b47596d18a4a409e4f Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Change the component formatting enum values so the default is zeroThiago Macieira2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | By having the default value equal to zero, we follow the principle of least surprise. For example, if we had url.path() and we refactored to url.path(QUrl::DecodeSpaces) Then instead of ensuring spaces are decoded, we make spaces the only thing encoded (unicode, delimiters and reserved characters are encoded). Besides, modifying the default can only be used to encode something that wasn't encoded previously, so having the enums as Encode makes more sense. As a side-effect, toEncoded() does not support any extra encoding options. Change-Id: I2624ec446e65c2d979e9ca2f81bd3db22b00bb13 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Merge QUrl::DecodeAllDelimiters and QUrl::DecodeUnambiguousDelimitersThiago Macieira2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | There's little value in having the DecodeUnambiguousDelimiters option since neither QUrl nor QUrlQuery can return values that are ambiguous in that particular context, ever. This option could be used to encode a character if, when placed in a URL, it would need to be encoded. Such cases are hash (#) or question marks (?) in the path component, or slashes (/) and at signs (@) in the userinfo. However, we don't need two enums for that, since there are no other characters that can appear in either form. Still, leave two bits for this enum. In the future, if we want to split the gen-delims from the sub-delims, we are able to. Change-Id: If5416b524680eb67dd4abbe7d072ca0ef7218506 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-101-1/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * Add QPA notes to QCursor pos() and setPos()Laszlo Agocs2012-03-271-1/+2
| | | | | | | | | | Change-Id: I7173816e0d792d6d26497b4fd59a57a50e512afd Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | Remove all calls to, and deprecate qMalloc, qRealloc and qFree.Robin Burchell2012-03-311-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callers should just call the standard allocation functions directly. Adding an extra function call onto all basic memory management for the sake of making it instrumentable in rare cases isn't really fair to everyone else. What's more, this wasn't completely reliable, as not everything was using them in a number of places. Memory management can still be overridden using tricks like LD_PRELOAD if needed. Their aligned equivilents cannot be deprecated, as no standard equivilents exist, although investigation into posix_memalign(3) is a possibility for the future. Change-Id: Ic5f74b14be33f8bc188fe7236c55e15c36a23fc7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Port to the new QUrl APIThiago Macieira2012-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of any broken-down components of the query now needs QUrlQuery. The QUrl constructor and toString() are now rehabilitated and the preferred forms. Use toEncoded() and fromEncoded() now only when we need to store data in a QByteArray or the data comes from a QByteArray anyway. Change to toString() or the constructor if the data was in a QString. Change-Id: I9d761a628bef9c70185a48e927a61779a1642342 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-231-8/+74
|\| | | | | | | Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
| * Remove QAccessibleEvent child parameter.Frederik Gladhorn2012-03-191-17/+21
| | | | | | | | | | | | | | | | | | This makes the api cleaner and generally the child should not be there. It is only sometimes more convenient not to create a QAccessibleInterface instance, so the functionallity is kept. Change-Id: I26018a6d3e0549f4d79856775b4167c5660e229d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Accessibility: add text update eventsFrederik Gladhorn2012-03-191-6/+68
| | | | | | | | | | Change-Id: Iece9d100b3f5a379d7d8e29dea67a10d0c918c06 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | Use the new QMetaMethod API in testlibKent Hansen2012-03-212-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Use QMetaMethod::name() instead of parsing the signature. Use QMetaMethod::returnType() instead of checking the length of typeName(). Use QMetaMethod::parameterCount() instead of checking the size of parameterTypes(). Change-Id: I424370b19b5b150865377666dca0fba5f29ad30f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* | testlib: Remove obsolete internal compare_helper overload.Jason McDonald2012-03-214-27/+0
| | | | | | | | | | Change-Id: Ic98faf360a713ac698f9bf1ff8aaad5a4c5c176b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-193-8/+59
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
| * Make copy and assign private for QAccessibleEvent.Frederik Gladhorn2012-03-181-4/+4
| | | | | | | | | | | | | | | | | | Also make the handling of events in the test pointer based since mac-g++ doesn't seem to like const references the way they were before. Change-Id: I7fe39978d4729b8e586be30978b74aa51ca7cfe6 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Fix broken qWaitForWindowShown() behaviorCharles Yin2012-03-162-4/+55
| | | | | | | | | | | | | | | | | | | | qWaitForWindowShown() should check window->isActive() instead of window->isExposed() and return false if timeout. Add two new qWaitForWindowActive() and qWaitForWindowExposed() functions. Change-Id: Idd9601805c2e84b0d36ddd5471031b627d289953 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-163-27/+42
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp src/gui/kernel/qplatformsurface_qpa.cpp tests/auto/corelib/tools/qtimeline/qtimeline.pro Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
| * Improved qWaitForWindowShown().Samuel Rødal2012-03-151-11/+11
| | | | | | | | | | | | | | | | | | Made faster by actually waiting for the window to be exposed, using similar waiting logic as qWait(). Should speed up autotests that use it quite a bit. Change-Id: I628c6110a554fdbbf5bed7e91f57c2fe341113ed Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * Use pointers for QAccessibleEvent.Frederik Gladhorn2012-03-151-7/+6
| | | | | | | | | | | | | | | | | | At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Deliver events in qtestmouseLaszlo Agocs2012-03-131-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Not waiting until the QPA event queue is processed after handleMouseEvent() is wrong. Unlike the synchronous sendEvent() calls these tests most likely utilized earlier, many of the QWindowSystemInterace functions are asynchronous in the sense that they just queue the event, delivery will happen when the event dispatcher on the main thread gets there. Change-Id: I8197d2dc4805cda684a8279ceb8d4b317f19aba7 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * Autotest details of QAccessibleEvent.Frederik Gladhorn2012-03-131-6/+17
| | | | | | | | | | Change-Id: Ieec33c23e7b18cfedf061088d6561203a5e7ac39 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | Remove QTEST_NO_SPECIALIZATIONSOlivier Goffart2012-03-144-33/+0
| | | | | | | | | | | | | | | | We don't support these compiler anymore Change-Id: I0eb73535b6c11703299430e5fc24c8e17fed1653 Reviewed-by: Samuli Piippo <samuli.piippo@digia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* | Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-03-127-81/+116
|\| | | | | | | | | | | | | Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
| * Use QAccessibleEvent in test.Frederik Gladhorn2012-03-121-24/+26
| | | | | | | | | | Change-Id: I4f9c0f503543caa5704a29c8ccd7c4134b455625 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * testlib: Improve formatting of QCOMPARE failure messages.Jason McDonald2012-03-123-9/+9
| | | | | | | | | | | | | | | | | | | | | | Make the various versions of the failure message align consistently so that it's a little easier to compare the actual and expected values. Of course, the value won't align nicely unless the "actual" and "expected" strings are the same length, but at least this commit makes that consistent across all versions of the message. Change-Id: If9ce231df3b5d279a06f6458fdb5da0aa4586068 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * testlib: Make QTestResult::verify() more robust.Jason McDonald2012-03-081-1/+3
| | | | | | | | | | | | | | | | | | | | The statementStr parameter should always be non-null, so assert if it is null. The description parameter can be null in some cases (particularly when the verify is successful, and thus no error description is going to be displayed), so tolerate this. Change-Id: I87b416d5f3b793bc608cd4aca14a4f7fe7527488 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * testlib: Improve verbose and XPASS outputJason McDonald2012-03-086-48/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as "COMPARE()", making it impossible to see what was compared and difficult to match the output to the source of a test containing many calls to QCOMPARE. This commit changes testlib's internal compare_helper API so that string representations of the compared expressions are always passed to QTestResult::compare() when available, and can thus be shown in the verbose and XPASS output. The XPASS output has also been changed to state explicitly that the comparison succeeded unexpectedly, bringing it in line with the XPASS output resulting from a call to QVERIFY. This commit also changes all calls to compare_helper() to call the eight-argument version of the function, which simplifies much of the calling code. The now obsolete four-argument version of compare_helper() has been changed to output a warning that it is obsolete. It will be removed once other modules have had some time to catch up. The improved XPASS and verbose output is demonstrated by the expectfail and verbose2 selftests. Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * testlib: Document a known limitation of QFINDTESTDATA.Jason McDonald2012-03-081-0/+6
| | | | | | | | | | Change-Id: I72740e394bfe2a95f5b48566b29c9ef9200a8035 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Merge remote-tracking branch 'origin/api_changes' into containtersJoão Abecasis2012-03-085-53/+47
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetaobject.cpp src/corelib/kernel/qvariant.cpp src/tools/moc/moc.h Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
| * Fix sending simulated keyboard events to popup widgetsMiikka Heikkinen2012-03-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Popup widgets steal the keyboard grab stealthily without it being visible via QWidget::keyboardGrabber(). To more accurately simulate a real keyboard event, prioritize sending simulated keyboard events to the active popup widget over QGuiApplication::focusWindow(). Task-number: QTBUG-24326 Change-Id: Id7a75c613d934e24657b521f1684ce7cce92556a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>