summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-042-22/+12
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| | * Add operator<<(QTestData &, QStringBuilder)Olivier Goffart2012-02-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | So this code still compiles with QStringBuilder QTest::newRow("foo") << foo + bar; Change-Id: Ie82a21c8fd07ec2d27ad85015aa1a0c4e94700d6 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| | * Merge master -> api_changesRohan McGovern2012-02-293-9/+16
| | |\ | | | | | | | | | | | | | | | | | | | | Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac. Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
| | * | QTestlib: no need to use the preprocessor to distinguish qrealOlivier Goffart2012-02-271-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code paths are actually the same, so merge them. Change-Id: I456b8a9a825cccdd80cd6a52a0a6737cde252363 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * | | Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-022-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * | | testlib: Improve documentation of verbose test logging options.Jason McDonald2012-03-021-5/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | Change the help output to show which options only work for plain text logging. Change-Id: I39eb7cd0793cdbe553c230334c6cd532b4929f61 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | | Introduce QMetaType::UnknownType.Jędrzej Nowacki2012-03-022-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaType::Void was ambiguous, it was pointing to a valid type (void) and in the same time it was signaling errors in QMetaType. There was no clean way to check if returned type was valid void or some unregistered type. This feature will be used by new QMetaObject revision which will store type ids instead of type names. So it will be easy to distinguish between: void mySlot(); MyUnregisteredType mySlot(); Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Rename QMetaMethod::signature() to methodSignature()Kent Hansen2012-02-292-7/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt5 the meta-data format will be changed to not store the method signature string explicitly; the signature will be reconstructed on demand from the method name and parameter type information. The QMetaMethod::signature() method returns a const char pointer. Changing the return type to QByteArray can lead to silent bugs due to the implicit conversion to char *. Even though it's a source- incompatible change, it's therefore better to introduce a new function, methodSignature(), and remove the old signature(). Task-number: QTBUG-24154 Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* | testlib: Improve the silent logging modeJason McDonald2012-02-282-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the silent logging mode suppressed passes, skips and internal testlib info messages, but did not suppress debugging output, making it hard to see the fails in a noisy test. This commit changes silent mode so that it suppresses all output except test failures and fatal errors, making silent mode truly useful for seeing just the important test output. This commit also adds a selftest to verify the behaviour of silent mode. Change-Id: I75420aead03682306210746a87e2a3b608b58fc6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | testlib: Remove commented-out code from plain text logger.Jason McDonald2012-02-281-2/+0
| | | | | | | | | | Change-Id: Ica2e294d1f08cac4697d037dbc2803012e0ba58a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | QtTest: add missing \since 5.0 to the new macrosDavid Faure2012-02-271-0/+6
| | | | | | | | | | Change-Id: I8f7060c41df1e0bf1a8c35930400a31a4239a3d6 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* | clean up qmake-generated projectsOswald Buddenhagen2012-02-241-1/+0
|/ | | | | | | | remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* CodeCoverage: Move installCoverageTool call.Caroline Chao2012-02-221-3/+3
| | | | | | | | | | | | Call it from qtest_qParseArgs() instead of qExec(). This will allow to remove the code coverage calls from quicktest. Both the installation and the saving of code coverage data are now gathered in testlib. Change-Id: If3baedb0cff9d894e6f232b947af7e3158703d9d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-211-1/+1
| | | | | | | | | as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use QMetaMethod::isValid() to check method validityKent Hansen2012-02-201-2/+2
| | | | | | | | | | The signature() method will soon be replaced by a function that returns a QByteArray rather than a pointer, and calling it will be more expensive than calling isValid(). Plus, isValid() looks nicer. Change-Id: I6844988c84dcadf876fc86bc71c8b310a21f88de Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* testlib: Report one test result per benchmark test.Jason McDonald2012-02-201-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit, a benchmark test could report 0..n passes and 0..m fails or skips, where n is the number of accumulation iterations used to collect benchmark data and m is the number of times the test function was invoked. Depending on the type of benchmark measurer being used, this could result in a very large volume of test output and inconsistent pass, fail and skip counts between test runs. This commit changes the behaviour so that each benchmark test reports one pass, fail or skip, regardless of the number of iterations used to collect benchmark data. This commit also prevents benchmark data being reported in the test output if the benchmark test failed or skipped, as any benchmark data is of dubious value in such cases. The latter change in behaviour requires a minor modification to the badxml selftest, which now tests quoting of literal strings in xml test output for both passing and failing benchmarks. Finally, this commit also adds a new selftest specifically for verifying correct behaviour for benchmarks that fail or skip. Task-number: QTBUG-24313 Change-Id: I3426dc659a7511b62fd183a031c7235bc753f497 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>