summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Remove QWindow pos, geometry and size as properties; pos->positionShawn Rutledge2012-11-081-1/+1
| | | | | | | | | | | Abbreviated properties are to be avoided. But all 3 of these properties are redundant from the QML perspective; and because QRect, QPoint and QSize are (wisely) not QObjects, it's not possible to bind to _their_ properties, which make these QWindow properties less useful than users might assume that they are. Change-Id: I19c00b54b1d2712f9418e8bcf56e35a8008b89ef Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update mac-specific code in qtestlib for Qt5Liang Qi2012-11-022-16/+8
| | | | | | | | | | | | 1. Remove the code for activate application, due to Qt 5 already has this feature 2. Update the code for power setting Task-number: QTBUG-23267 Change-Id: Id257c2e10e8e750a4b68cd2995c2ac4b70f8910c Reviewed-by: Jiang Jiang <gzjjgod@gmail.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
* Fix build when libQtGui is not availableHarald Fernengel2012-11-011-1/+5
| | | | | Change-Id: I9e35d9302f58d283459f7e625c4e0b87fd1dc2bf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Testlib: Disable gcc warning about deprecated qInstallMsgHandlerKai Koehne2012-11-011-0/+10
| | | | | | | Fix warning: 'void (* qInstallMsgHandler(QtMsgHandler))(QtMsgType, const char*)' is deprecated (declared at qtestlog.cpp:85) [-Wdeprecated-declarations] Change-Id: I28d2baf696fdeddec90780edc88574fc368468db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* List possible matches when specifying invalid test function.Friedemann Kleint2012-10-291-6/+10
| | | | | | | | List functions matching the command line parameter instead of dumping all functions. Change-Id: Ic504587b1036f09702f47579f90406333c4efbeb Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Clarify assert on use of const char* as TestData type in tests.Mitch Curtis2012-10-241-0/+3
| | | | | | | | | | Currently all C-style strings used as data types in QTest::addColumn will assert at runtime with, e.g.: "expected data of type 'const char*', got 'QString' for element 0 of data with tab 'blah'". This patch makes it clear that C-style strings are disallowed. Change-Id: Iadbb8f10e16607de95c7adb43d9ff3310aac6738 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* remove explicit load(qt_build_config)s from the librariesOswald Buddenhagen2012-10-191-2/+0
| | | | | | | .qmake.conf (and previously .qmake.cache) already does that for us. Change-Id: I06cc01fa45921d7bd66dda7a0f88729faeff37bd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make sure we copy *all known events* properly in order to not assert.Jan Arve Saether2012-10-181-0/+8
| | | | | | | | | This caused the following assertion in tst_QAccessibility::listTest(): ASSERT: "m_type != QAccessible::TableModelChanged" in file qaccessible.h, line 455 Change-Id: If1f1e80521f346019bdbd59aac58e30c870d6e4e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Logging: Mark deprecated API with QT_DEPRECATEDKai Koehne2012-10-161-0/+8
| | | | | | | | | | Still use it in qtestlib though because using qInstallMessageHandler here would break all tests (still) using qInstallMsgHandler - Qt always uses the new message handler if there's one, ignoring any message handler installed through deprecated API. Change-Id: I6fefefb315a2421425d2b7787e367fd348a33d83 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Removed references to stale links.Jerome Pasion2012-10-131-8/+0
| | | | | | | The links are from the qt-webpages.qdoc and no longer exist. Change-Id: I8329032215fa77811117e2767bae745795b209cb Reviewed-by: Martin Smith <martin.smith@digia.com>
* Modularize documenation buildTor Arne Vestbø2012-10-102-4/+2
| | | | | | | | | | qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global includes, instead of using relative paths. Qt modules will automatically get a doc target that builds and installs into the right place (including supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module). Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Make QUrl::errorString() usable for QtTest output in invalid URLsThiago Macieira2012-10-021-0/+2
| | | | | | | | | If an URL is invalid, let's indicate that in the test output. To be helpful, let's make QUrl::errorString() include the component form of the URL. Change-Id: Iaafe16973ded79c7ea688fbb23808d91253e8c14 Reviewed-by: David Faure <faure@kde.org>
* TestLib: Fix MinGW compile warningKai Koehne2012-09-281-1/+1
| | | | | | | | | MinGW-64 defines _CrtSetReportMode, but only as a noop, resulting in a warning "statement has no effect [-Wunused-value]" Change-Id: I6e509246134dd5929b23b07abdb6d705db603793 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* qtest.h: add missing QT_NO_DATESTRING guardsJ-P Nurmi2012-09-261-0/+2
| | | | | Change-Id: I04d8ec2e9d41399cffc610f943fc06e043831ceb Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* QTestLib: clean up qCompare specialisation/overload mixMarc Mutz2012-09-234-31/+17
| | | | | | | | | | | | | qCompare() was both overloaded and specialised, but always as a template. This lead to the QIcon specialisation actually invoking qCompare(QFlags<void*>, ...) when specifically asking for qCompare<void*>() (detected by adding underlying-type detection to QFlags). Fix by preferring overloading and not specialising anything. Change-Id: Ie001ebb9dfb0847c6c33a3f45177a61579fd61ee Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2266-1427/+1427
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix qtestlib-manual.qdoc errors.Mitch Curtis2012-09-132-22/+64
| | | | | | | | | Corrected paths to tutorials and added qt-webpages.qdoc for missing links. Change-Id: I1c318f2f80804b73941acfcb5a53df456108f018 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Do not include /examples in qdocconfs.Frederik Gladhorn2012-09-111-1/+1
| | | | | Change-Id: I84a925a8be4964fae667f5a2500157283a8057d2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Doc: Centralize more common settings in 1 global qdocconf.Casper van Donderen2012-09-111-36/+1
| | | | | | | | | | All qdocconf settings that should be used by all Qt modules are now in qt-module-defaults.qdocconf. Change-Id: I2a0315a55db3fcbb0160c4392d2da98611043d83 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QTest::qExec crash with no command line argumentsJeremy Lainé2012-09-081-1/+2
| | | | | | | | | | | | | | | The documentation for QTest::qExec states that command line arguments are optional and gives the following example: MyTestObject test1; QTest::qExec(&test1); However, running this example leads to crash as argv[0] is accessed without testing argc. This change fixes this bug. Change-Id: I2ec016e02869d21b24bc11f1851a760036640191 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Doc: Fix docbuild when not using -developer-build.Casper van Donderen2012-09-011-2/+2
| | | | | | | | https://codereview.qt-project.org/#change,33974 only works in the case of a developer build. Not in a normal prefix build. Change-Id: I3a3e5029cefaa9f83c5deb71665f0efa9d812819 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Simplify qtbase qdocconfs.Casper van Donderen2012-08-311-15/+2
| | | | | | | | | | We should be using the global qdocconf for the common variables. This change also allows you to just specify -installdir without using a templatedir. Change-Id: I207d279d9b5199212e896fc5ccab5c212b1896c6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Logging: Remove mutex for OutputDebugStringKai Koehne2012-08-301-13/+0
| | | | | | | | | | | | OutputDebugString seems indeed to be thread safe, at least according to http://www.unixwiz.net/techtips/outputdebugstring.html . I also didn't manage to run into any deadlocks on Windows 7 ... The comment + code was already there (in qcoreapplication_win.cpp) in the first git commit that imported Qt. Change-Id: I442e22575558958ef21ab8c6b4cc8b03aee906b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Exclude the examples/widgets/doc dir for all but widgets.Frederik Gladhorn2012-08-291-0/+2
| | | | | | | | There are too many references to the QWidget lib documentation in there. On the other hand this keeps snippets working. Change-Id: I7dd63b7fba1758accea2663f7b427940a8857e32 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* 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>