summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate qWaitForWindowShown QWidget* overload since 5.0.Stephen Kelly2012-08-271-2/+2
| | | | | | | | It is already documented as deprecated in 5.0, so marking it as deprecated since 6.0 is silly. Change-Id: If72cc81bdad18c907022c48b9aa8e7d87eb88e59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove qWaitForWindowShown(QWindow*) overload.Stephen Kelly2012-08-232-18/+0
| | | | | | | | The QWindow* overload was introduced for Qt 5.0, but is unused already. Change-Id: Ic07f19eac87bc93a589017407668760fceb2f632 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* fix some QTest documentationJeremy Katz2012-08-212-7/+7
| | | | | | | | | | | | * Use \b instead of \bold * widnow -> window typo * QTest::touchEvent's second parameter is QTouchDevice *, not QTouchEvent::DeviceType, and autoCommit defaults to true * QSignalSpy::wait() isn't const Change-Id: I75a91c1cd98b1c582cd654b2b72ad61e5c0e31d2 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Doc: Fix spelling errorsSergio Ahumada2012-08-171-1/+1
| | | | | Change-Id: Ibae8d10183f6b15a16b1499daa2df8802dbb014e Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* QtTestLib: use new qEnvironmentVariableIsEmpty()Marc Mutz2012-08-141-7/+10
| | | | | | | | | | Except where using the contents of the variable, in which case collapse two calls to qgetenv() for the same variable into one that stores the result in a temporary QByteArray and continues working with that one instead. Change-Id: I6c09a20ae946327ccb85e4833a60a373a8a07355 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix order of namespace/include guards.Frederik Gladhorn2012-08-111-3/+2
| | | | | Change-Id: I9ed1e82c90e38a65c15bb9d05ff789270218d4b5 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* rename qt_module_config.prf => qt_module.prfOswald Buddenhagen2012-08-081-1/+1
| | | | | | | this is more logical, following the qt_plugin and qt_tool scheme. Change-Id: Ib3b2abec6728cdab260e15128b1cd78e8e6f5d6a Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Make QSignalSpy copy QVariant parameters directlyKent Hansen2012-08-071-1/+4
| | | | | | | | | | | | | | | | | | | | | Previously, a QVariant parameter would be wrapped inside a new QVariant, and you would have to cast the QSignalSpy's QVariant to a QVariant to get the actual value. This behavior was unintuitive and undocumented. Check if the parameter type is QVariant, and copy it directly if it is. This makes the QSignalSpy's QVariant directly usable (no need to "unwrap" the value in user code). Existing tests that use QSignalSpy together with QVariant parameters (such as tst_QPropertyAnimation::valueChanged()) and do cast the QVariant parameter to a QVariant, continue to work after this change; this is because qvariant_cast<QVariant>() returns its input value (unchanged) when the type is not QMetaType::QVariant. Task-number: QTBUG-21645 Change-Id: Ibfb171edd60c0d3f7ca1d5419e5c5f3d0380d5b3 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Make tests compile without gui-privatePaul Olav Tvete2012-08-024-39/+18
| | | | | | | | | | | | | Add new qt_handleXXX functions that forward to the QWindowSystemInterface functions, and use those in the testlib inline functions. Remove use of struct QWindowSystemInterface::TouchPoint from the testlib header files (requiring some slight increase in ugliness in the two tests that use that struct). Also remove the qmake hack that adds private headers to all tests Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Fix some syncqt warnings.Lars Knoll2012-08-011-1/+7
| | | | | Change-Id: I6f432ee991f4bde217fa27d4004ef318f1d480e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QSignalSpy::wait() method.David Faure2012-07-254-4/+31
| | | | | | Change-Id: I1f3b49e3dee19bf0b1d2933c6e6ad7972186e0d0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Deprecate the qWaitForWindowShown(QWindow *) method.Friedemann Kleint2012-07-251-2/+3
| | | | | | | | | | | | | | While the qWaitForWindowShown(QWidget *) is inherited from Qt 4.8, the qWaitForWindowShown(QWindow *) was introduced in Qt 5. As it is identical to qWaitForWindowExposed() and removed already, it can be deprecated in Qt 5. Remove its usages in qtbase. Change-Id: I28788d120ad687a49f02b2b44de6b38a2832fe5c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Provide public API for native event filtering, moved up from QPA.David Faure2012-07-202-14/+19
| | | | | | | | | | | | | | | | | | The previous API was hard to use (global function, no type safety, manual chaining), and confusing (app vs dispatcher split only made sense on Windows). Installing and removing out of order would have the risk of setting back a dangling pointer (crash). Meanwhile QPA added type safety, and this new API models the QObject::installEventFilter API for ease of use. The virtual method is in a new interface, QAbstractNativeEventFilter. QPA was even calling the dispatcher event filter with QPA-private event classes, which made no sense (refactoring leftover from when the code was in the dispatcher). Now the QPA plugins trigger the qcoreapp event filters with the actual native events directly. Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Implement waitForWindowExposed and friends for widget windows.Friedemann Kleint2012-07-203-33/+74
| | | | | | | | | | | | | | - Implement waitForWindowExposed() for toplevel windows. - Implement waitForWindowShown(QWidget *) and mark as deprecated in line with waitForWindowShown(QWindow*). - Use in tests. - Simplify tests (collapse waitForExposed, setActive into setActiveWindow, waitForActive), remove most hard-coded timeouts. - Stabilize graphicsview tests by using waitForWindowActive. Change-Id: Ic7c061e2745b36f71a715ee4e47c0346b11a91e8 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Move QWindowSystemInterface out of qpa.Stephen Kelly2012-07-193-3/+3
| | | | | | | | Public QtTest headers require it, so all unit tests would have to use private Qt headers otherwise, which is not practical. Change-Id: I5d4466ec30b6a57ebdfc34413e716e657eb51368 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* remove needless/commented INCLUDEPATHsOswald Buddenhagen2012-07-181-1/+0
| | | | | | | Change-Id: Id1d3afde424e0e17e68889d6f7b51e3056754536 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* doc/snippets: normalize signals/slotsMarc Mutz2012-07-131-1/+1
| | | | | | | | | | | | | There's one in corelib that has a comment // slower due to signature normalization at runtime I obviously didn't change that one. This is the result of running util/normalize --modify from Qt 4.7 with manual review. Change-Id: I0ffb2305800a9cb746b7f8a4eb710702d64f1b92 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Improve accessibility test helpers.Friedemann Kleint2012-07-131-4/+27
| | | | | | | | | - Wait for accessibility events using qWait, allowing for event processing, - Output a verbose message if the event cannot be found. Change-Id: Iaadbd235c15dd12bb14724e1724dd04328532a96 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Implement qWaitForWindowShown using qWaitForWindowExposed.Friedemann Kleint2012-07-121-2/+4
| | | | | | | Deprecate qWaitForWindowShown for Qt 6 as it is just a wrapper. Change-Id: I0f8195679679120bd402e273fed4d331dc926708 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Doc: Replace all occurences of \BR with \br.Casper van Donderen2012-07-061-32/+32
| | | | | Change-Id: I9b0fac5fac7b0467de2d9a57a951b10a0f5438d7 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Make QWindowSystemInterface part of QPA APIGirish Ramakrishnan2012-07-033-3/+3
| | | | | | | | | | | | | | | As discussed on mailing list and QtCS 2012. Any file starting with qwindowsystem is now marked as QPA API. This change drops _qpa from the filenames and adds gui-private where required for the code to compile. This change is backward compatible otherwise and compat headers are created for the old inclusion headers. Change-Id: I72ea0f394dee74f46e614fcf11ab5500ac9fef2a Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Update the macros for shared/DLL and static buildsThiago Macieira2012-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, we had a mess of different macros used for building DLLs, for building shared libraries on Unix systems and for building static libraries. Some of the macros were contradictory and did not work. From now on, there shall be only: - QT_STATIC: indicates that it's a static Qt build and the export macros should expand to empty - QT_SHARED: indicates that it's a shared / dynamic Qt build and the export macros should expand to Q_DECL_EXPORT or Q_DECL_IMPORT, depending on whether the macro corresponds to the current module being built (the QT_BUILD_XXXX_LIB macro comes from the module's .pro file) QT_BOOTSTRAPPED implies QT_STATIC since the bootstrapped tools link statically to some source code. QT_STATIC is recorded in qconfig.h by configure when Qt is configured for static builds. Nothing is recorded for a shared / dynamic build, so QT_SHARED is implied if nothing is defined. This allows for the existence of a static_and_shared build: with nothing recorded, defining QT_STATIC before qglobal.h causes the export macros to be that of the static form. Linking to the static libraries is out of the scope of this change (something for the buildsystem and linker to figure out). From this commit on, the proper way of declaring the export macros for a module called QtFoo is: #ifndef QT_STATIC # ifdef QT_BUILD_FOO_LIB # define Q_FOO_EXPORT Q_DECL_EXPORT # else # define Q_FOO_EXPORT Q_DECL_IMPORT # endif #else # define Q_FOO_EXPORT #endif The type of the Qt build is recorded in QT_CONFIG (in qconfig.pri) so all Qt modules build by default the same type of library. The keywords are "static" and "shared", used in both QT_CONFIG and CONFIG. The previous keyword of "staticlib" is deprecated and should not be used. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-April/003172.html Change-Id: I127896607794795b681c98d08467efd8af49bcf3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add const & to foreach 'iterators'Albert Astals Cid2012-06-271-2/+2
| | | | | | | Change-Id: I8c0600dfd919f45d14a0011f2da9b9fe0b9a0df3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fix QCOMPARE for QIcon in QtGuiGiuseppe D'Angelo2012-06-261-2/+0
| | | | | | | | | There's no need of QtWidgets for using QCOMPARE on two QIcons, as QIcon lives in QtGui. Change-Id: I40c3d4aeb15fb95876449383d9e2dd1ad39aa5f9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* make using testlib automatically "promote" all modules to -privateOswald Buddenhagen2012-06-261-1/+1
| | | | | | | | | | | | autotests often need private headers (especially with qpa headers now being private) and have no compatibility requirements, so it makes sense to just use the privates of requested modules. this also suppresses the useless warning about using privates, in case they are still explicitly specified. Change-Id: I9e499bedcf6ef25777283ff1432cef7254e9093a Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Use valSeen since it results in unused warning otherwiseGirish Ramakrishnan2012-06-261-1/+2
| | | | | Change-Id: Iccfa4b895d9e50227efa1747ea20ce07ce70327e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QWS references from testlibGirish Ramakrishnan2012-06-212-11/+0
| | | | | Change-Id: Iad52a5c44b27cb11a47987c9f8890cc67b557fb7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add new benchmark metrics to testlibChris Adams2012-06-212-1/+18
| | | | | | | | | | | | | | | QElapsedTimer provides nanosecond-resolution elapsed timing, which allows for finer granularity benchmark reporting. Also, clients may also wish to benchmark the memory usage of a particular component, but no metric currently exists which matches that requirement. This commit adds the WalltimeNanoseconds and BytesAllocated metrics to meet these needs. It is intended for manual use by clients via setBenchmarkResult() only. Change-Id: Ib37ada374e265c857eda02d047d51d436618e4a7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* fix misnomer: qt_module.prf => qt_build_config.prfOswald Buddenhagen2012-06-191-1/+1
| | | | | | qt_module suggests to be congruent to qt_plugin. Change-Id: I629530bcbe2ba6c0adbdc11a275119c8aff0c953
* automatically add QT_BUILD_FOO_LIB to DEFINESOswald Buddenhagen2012-06-192-2/+1
| | | | | Change-Id: I35d9861e48469eb5cc8824e361450684047e6559 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* clean up projects from QPRO_PWD nonsense, etc.Oswald Buddenhagen2012-06-191-1/+0
| | | | | Change-Id: I4c41aedf5bfb37e31ad202cacd2312b0bdb168e2 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* auto-generate module prisOswald Buddenhagen2012-06-191-1/+1
| | | | | Change-Id: I654428771034221ccf424be34d5d9c7764daf3b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* automatically add the version header to HEADERSOswald Buddenhagen2012-06-191-2/+0
| | | | | Change-Id: I7c2e1d852ebdbc5cca7a3a31ab2b4c9ab9faffd9 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make qt_module_config.prf install the module pri fileOswald Buddenhagen2012-06-191-1/+1
| | | | | | | | | absorb module.prf into qt_installs.prf, as that's where it belongs. add qt_install_module option and automatically set it in qt_module_config. make qt_installs use that option. Change-Id: I860616f3a29a456f7b88ddaffa09375400c8911e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* 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>