summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Move pass/fail/skip counters from QTestResult to QTestLog.Jason McDonald2012-01-175-21/+51
| | | | | | | | | | | | | | | This change will enable further simplification of QTestResult and QTestLog in the future, including removing a circular dependency between the two classes. The "getter" functions in QTestResult are retained for now, but will be removed in a future commit, once QtQuickTest has been changed to call the getters that this commit adds to QTestLog. This commit is adapted from an unfinished change by Henrik Hartz. Change-Id: Ife7f80ac6a4310449a4712e96e0bea6c02139a5a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove unused QTestResult::allDataPassed().Jason McDonald2012-01-162-6/+0
| | | | | | | The removed function was private API and was not used anywhere in Qt. Change-Id: Ia262d119ebba30f6968cb7145043475bf88ffa39 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Rename QTestLog::addIgnoreMessage to QTestLog::ignoreMessage.Jason McDonald2012-01-163-3/+4
| | | | | Change-Id: I4cfcd00d444d0812c58afab6ffd43dee37db1340 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Compile if the header files from QtWidgets are unavailableLars Knoll2012-01-124-5/+18
| | | | | Change-Id: I0a774fc1492e882bc6c02d913e6dace189fdb992 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
* QStyleHelper: Base DPI-calculation on QScreen.Friedemann Kleint2012-01-111-0/+4
| | | | | | | | | | | | | | | - Use qt_defaultDpiX() to obtain the resolution, which obtains it from QScreen. This implies that for X11, which previously used a hardcoded default of 96 DPI, the real resolution will be used (typically 75). - Since many tests (layouts, graphicsview) contain test data for 96 DPI, add an attribute to QCoreApplication making it possible to set the resolution to 96 DPI for testing. Change-Id: I77c8233a96b0d75de07406f58d48886a89c3de06 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Tests: Remove duplicate QTRY_VERIFY/QTRY_COMPARE macros in bearer.Friedemann Kleint2012-01-102-16/+41
| | | | | | | | | | Introduce QTRY_VERIFY_WITH_TIMEOUT and QTRY_COMPARE_WITH_TIMEOUT to be able to specify a timeout value. Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Change-Id: Iaeaa4938eb14f2c431537055f626510cba183ce3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove the Q_TYPENAME define.Stephen Kelly2012-01-081-4/+4
| | | | | | | | | | | | | It is mostly not used (most places in Qt use typename directly), so is already not very useful. For example typename is used in: QDataStream& operator<<(QDataStream& s, const QVector<T>& v) Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0556-56/+56
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QTestlib: Make QImage comparison more verbose.Friedemann Kleint2011-12-211-0/+62
| | | | | | | | | | | | | | | | | | Introduce a specialization for qCompare(QImage,QImage) that checks isNull, size and format and outputs verbose messages. Check isNull, size similarly for QPixmap. Add an autotest: - Add test to cmptest and make it a GUI application since QImage requires QGuiApplication. - Make testlib/selftests capable of running X11-GUI applications by passing DISPLAY. - Ignore stderr output for cmptest - Add test data Change-Id: I2b29c7822fbeedf2b22c90889739ed7ff859ce92 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* QTestLib: Fix QFINDTESTDATA for Windows.Friedemann Kleint2011-12-211-13/+27
| | | | | | | | | | - Scan the parent directory of the executable if it is located in a 'Debug' or 'Release' directory - Report with native separators in the log. - Use the QString::arg() overloads with several string parameters. Change-Id: I5ea84411e12978f8f958a0bce3ae10da44cc4e3f Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix -tickcounter in qtestlib.Robin Burchell2011-12-211-2/+0
| | | | | | | | | | HAVE_TICK_COUNTER is supposed to be set (if possible) from cycle_p.h, so guarding cycle_p.h's inclusion with HAVE_TICK_COUNTER ensures it will never be set. Change-Id: I6313d0a2efd47c89522623e8e7b3f505489ded90 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Retire QTest::pixmapsAreEqual().Jason McDonald2011-12-201-15/+0
| | | | | | | | | | | | | QTest::pixmapsAreEqual() was left in the Qt4 API for compatibility with some old tests written for Qt3. QCOMPARE() is the preferred way to compare QPixmaps and provides superior diagnostic output when a comparison fails. This commit removes QTest::pixmapsAreEqual() from the testlib API and replaces the last few remaining calls with QCOMPARE. Change-Id: I051c0e7d3bda072855fcd262d82e8e540619233b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Avoid confusing method overloading in QTestTable.Jason McDonald2011-12-191-6/+6
| | | | | | | | | The private class had two append() methods, one appending a column and one appending a row. Use more meaningful names instead of overloading orthogonal operations. Change-Id: I97e0268d6cb289694557846f244fe770cf980aaf Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Avoid qDebug in verbose benchmark test output.Jason McDonald2011-12-161-2/+6
| | | | | | | | | | Use QTestLog::info() rather than qDebug() to output informational messages from testlib. Source file and line are deliberately omitted as they would come from testlib rather than from a test program. Change-Id: I7b479bba4d3d553c6fa846d8d5ea2c29a8ef42b8 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Switch off signal dumper when testing is completed.Jason McDonald2011-12-161-0/+3
| | | | | | | | Previously, if the signal dumper was switched on with the -vs command-line switch, it would never be switched off again. Change-Id: I192e188010471525723fad0844ff33e9482128ea Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove Qt5 comment from qsignalspy.h.Jason McDonald2011-12-151-2/+0
| | | | | | | | | | The removed comment refers to a task in a bug tracker that no longer exists. The comment also mentions making (part of) testlib use Qt's regular binary compatibility mechanisms, which is desirable in the long term but not in scope for Qt 5. Change-Id: I6f23a9a2c8a84e30afe2aeb5c53ea93c25ba6f11 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix incorrect function name in assertion.Jason McDonald2011-12-151-1/+1
| | | | | Change-Id: I3eb8e7afe3f7ca514dd4839e603612b56c7d8082 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QTest::qt_snprintf() from testlib API.Jason McDonald2011-12-152-17/+0
| | | | | | | | | | | | | | | | | | This was an internal function that used to act like qsnprintf() but also filtered unprintable characters out of the test output. The filtering has been moved somewhere more appropriate and this function is no longer used by testlib. Unfortunately, the function was exposed in the public API due to its former use in the implementation of a public macro. In the unlikely event that any code outside testlib calls this function, the call should be replaced by calling qsnprintf(), which comes from the QtCore/QByteArray header. Change-Id: Iddc17b4361d16ebddd19346ae7d1064951dd7738 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Improve QTest::keyClick documentation.Jason McDonald2011-12-151-7/+12
| | | | | | | | Make it clear that the delay is applied before each key-click is simulated. Change-Id: Id100f1f2db1a5b1651c3046905719d7eb06ec1a0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update documentation of QTEST_MAIN macro.Jason McDonald2011-12-151-7/+12
| | | | | | | | | Update the docs to describe the behaviour that resulted from moving the traditional Qt widgets into a separate library from the rest of GUI classes. Change-Id: Ibd0ef05cc871b8f5a6700e421aa41bdf64c1210b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve QCOMPARE for QStringListJason McDonald2011-12-151-6/+7
| | | | | | | | | After establishing that both lists are the same size, there is no need to calculate the minimum of the list sizes. Also, use sizeof() instead of hard-coded values when calling qsnprintf(). Change-Id: I2396cf3f941770229e1cef6422aeddbe549c51fc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove redundant touch processing in QtGui and widgets.Laszlo Agocs2011-12-141-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The duplicated hash tables in QGuiApplicationPrivate and QApplicationPrivate are now unified into one single hash table in QGuiApplicationPrivate. This also reduced the number of lookups. The extra processing needed to keep the touch points' first/lastPos values in sync is now done only once, in QGuiApplication. This eliminates the performance penalty (for widget-based apps) that was introduced during the QPA migration. As an added bonus the patch adds support for touch events arriving simultaenously from multiple devices. This was broken before: As there is no guarantee that two devices/drivers will not send touch points with the same ID, using structures with only the ID as key is wrong. The proper key is composed of the device ID (that is, a QTouchDevice pointer) and the touch point ID. The exported internal function qt_translateRawTouchEvent() has been removed. This function cannot work properly in the QPA world: It injected touches into the widget subsystem (QApplication) only which is wrong, and would result in half-filled touch events due to not routing the injected data through QGuiApplication. Autotests using this function are migrated to QWindowSystemInterface::handleTouchEvent(). Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove incorrect information from QCOMPARE documentation.Jason McDonald2011-12-141-3/+0
| | | | | | | | | | The documentation stated that QStringList objects would be compared starting from the end of the lists. The implementation in qtest.h actually starts at the beginning of the list, and always has done since qtestlib became part of Qt. Change-Id: I056f584564d46402ba23fc6a89c801cb5c3c6262 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add missing assertion to QAbstractTestLogger.Jason McDonald2011-12-131-0/+1
| | | | | | | | | If passed an empty string, QAbstractTestLogger::outputString() would crash, so add a QTEST_ASSERT to make the cause of any crashes more obvious. Change-Id: I00afe2e73120b87e211f858402d441f345dddd08 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* testlib: fixed actual, expected order in QTest::compare_helperRohan McGovern2011-12-131-1/+1
| | | | | | | | | | These two parameters were written in the opposite order in the function's declaration and definition. Harmless to the compiler, but confusing to developers and reviewers. Change-Id: I1d4cb0a41b465b5f918daa76756677fe0cfe0a59 Reviewed-by: Jason McDonald Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Store the primary status in the touch point flags.Laszlo Agocs2011-12-121-1/+1
| | | | | | | | | | | | | | | | | For some reason the primary bit has previously been encoded in the touch point state, even though it has nothing to do with the regular states like Pressed, Released, etc. The value is now stored in the recently introduced flags member of the touch points. This also reduces the need for error-prone internal masking of the state value. The structure used by QWindowSystemInterface::handleTouchEvent also becomes cleaner because the primary status can now be set in the flags member and the isPrimary bool can be dropped. Change-Id: I1da2cb99154afd97e1e3a5943ab115cae3a8232f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Revert "Remove unused overload of QTest::qExec."Friedemann Kleint2011-12-122-0/+29
| | | | | | | | | | | | | | | | The overload is used in Qt Creator (see src/libs/extensionsystem/pluginmanager.cpp). The use case here is an application whose internal QObjects can be tested by passing a command line parameter. For this use case, it is inconvenient to have to allocate memory and create a char argv[]- array. This reverts commit ad80d42f8eefd72d9297c272139acc70e24bfa13. Change-Id: I2a2f91e2840100fd62743f6d03b33005d67b18f8 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Remove -keyevent-verbose option for autotests.Jason McDonald2011-12-121-12/+0
| | | | | | | | | This option does nothing -- the only function that checks if the option has been set is never called. This appears to have been the case ever since testlib was imported into the Qt repository in October 2005. Change-Id: I837aa957e2d8bd47c3d1c551f1b94d4374daa25e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Stop using QTest::qt_snprintf() in testlib.Jason McDonald2011-12-127-61/+49
| | | | | | | | After the previous commit, QTest::qt_snprintf() is equivalent to qsnprintf(), so just use that instead. Change-Id: I89ad6e3749ba5efb1926b0b618a904e8baca9f52 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve definition of QTEST_NO_SPECIALIZATIONSJason McDonald2011-12-121-1/+1
| | | | | | | | Remove the part of the definition that applies to gcc versions <= 2.x as these versions are not supported by Qt5. Change-Id: Icee6b51ffe78fa30fd7193ef96b6ce0484b8fcae Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Filter unprintable chars out of all test output.Jason McDonald2011-12-123-15/+18
| | | | | | | | | | | | | | | | | | Previously, unprintable characters were filtered out of test output while the output strings were being formatted by either qt_snprintf() or qt_asprintf(). Any strings not formatted by one of those functions weren't filtered at all, and any strings passed more than once would be filtered more than once. This commit separates the filtering of output strings from their formatting, leaving the filtering until just before the strings are written to the output stream. For now, the filtering is done by a protected method of QAbstractTestLogger, but this could easily be changed to a virtual method in future to allow different filtering for loggers with different output character sets. Change-Id: Ia4bb49cd10d37c84af75d2cf58325d27f0e16d99 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove event type parameter from handleTouchEvent.Laszlo Agocs2011-12-091-1/+1
| | | | | | | | | | | Requiring platform and generic plug-ins to pass TouchBegin, TouchUpdate, or TouchEnd is unnecessary. The type can be easily deduced from the touch point states. In fact handleTouchEvent already collected the combined point states, it was just not utilized until now. Change-Id: Icf3c787fefdebc51609a763bc4286c18a0b6aac2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Extend touch events.Laszlo Agocs2011-12-091-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capability flags indicate which information is valid in the touch points. Previously there was no way to tell if e.g. the value returned by pressure() is actually the value provided by the driver/device or it is just something bogus due to pressure not being supported. The points' flags return information about the individual touch points. One use case is to differentiate between touches made by finger and pen. Velocity, if available, is now also exposed. Each touch point can now contain an additional list of "raw" positions. These points are not reported individually but are taken into account in some way by the underlying device and drivers to generate the final, "accurate" touch point. In case the underlying drivers expose these additional positions, they are made available in the lists returned by the touch points' rawScreenPosition(). The raw positions are only available in screen coordinates to prevent wasting time with mapping from global positions in applications that do not use this data. Instead, apps can query the QWindow to which the touch event was sent via QTouchEvent::window() and can call mapFromGlobal() manually if they need local raw positions. The capability and device type information is now held in a new QTouchDevice class. Each touch event will contain only a pointer to one of the global QTouchDevice instances. On top of type and capability, the new class also contains a name which can be used to differentiate between multiple touch input devices (i.e. to tell from which one a given QTouchEvent originates from). The introduction of QTouchDevice has three implications: The QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent need to be changed (to pass a QTouchDevice pointer instead of merely a device type value), and each platform or generic plug-in is now responsible for registering one or more devices using the new API QWindowSystemInterface::registerTouchDevice. Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove unused overload of QTest::qExec.Jason McDonald2011-12-082-29/+0
| | | | | | | | | | | | | The overload of QTest::qExec() that takes a QStringList is not used anywhere in Qt's autotests, despite having been in the qtestlib API since Qt 4.4. This lack of use most likely derives from the fact that none of the QTEST_MAIN macros use the overload, and more than 99% of Qt's tests use those macros to avoid explicitly calling QTest::qExec(). Change-Id: I264b21d7fe1a9f2d565f748cf8bbe32414a73bb0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove obsolete autotest parameters.Jason McDonald2011-12-061-10/+0
| | | | | | | | | | | | | | Previously, autotests silently ignored the -graphicssystem and -qws parameters so that test-runners did not need to include logic to decide whether to pass those parameters depending on whether a particular test was a GUI test or a non-GUI test. In Qt 5, both of those parameters have been removed from QApplication, so tests don't need to ignore them anymore as they should no longer be supplied to any test. Change-Id: Ic59e38ddfa3303e760645ed1782a211340ce70f2 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update documentation for QTest::qExec()Jason McDonald2011-12-021-10/+15
| | | | | | | | | Update the documentation to make it clear that regular test applications should not call QTest::qExec() more than once. Also minor rewording of description of return value. Change-Id: I45bdf520ed10fd3c9232847a0ec0bc2b32d4caf3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* testlib: add QFINDTESTDATA macro for finding testdata filesRohan McGovern2011-12-012-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automated tests often need to load some data from external files. Currently, a wide variety of approaches for this have been used in Qt autotests, including: - embed the source directory into the test binary at compile time, and find the testdata relative to that; this fails when the source tree is no longer available (e.g. when the tests are deployed to a device). - use a path relative to the current working directory, and trust that the caller always sets the current working directory such that the testdata can be found; this fails when the caller uses a different working directory than expected. - use a path relative to QCoreApplication::applicationDirPath(); this fails when source tree != build tree (since testdata is not automatically copied into the build tree). - compile the files into the binary using the Qt resource system; this should work, but does not allow for testing of code which genuinely needs external files. It seems that there is not a simple method for determining the testdata path which can be reliably used in all circumstances, so various tests have reinvented the testdata location method in different ways. Therefore, this is a good candidate for an addition to the testlib API. The current implementation of QFINDTESTDATA is able to find testdata in all three of (build tree, install tree, source tree), in that order. Change-Id: Ib2fed860723ccf437240da3b00db22dfe1a6b56c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Use Q_FOREACH in headers.Stephen Kelly2011-11-271-1/+1
| | | | | | | Downstreams must be able to use QT_NO_KEYWORDS. Change-Id: Ica75b348c1c9461750b5ae2426557ed8b9e2a8a1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make QTest::newRow a bit more verbose if a data tag is null.Jędrzej Nowacki2011-11-161-0/+1
| | | | | | | | | | Currently QTest::newRow function expects to have correct tag string for each test data. This was enforced by a simple assert. By adding a an assert with message we might simplify debugging of a test that generates test cases. Change-Id: I84ebb397264c99e7bb46d281fd38583dd2d6964c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Integrate testcocoon support into Qt build system.Rohan McGovern2011-11-151-0/+33
| | | | | | | | | | | | To instrument a Qt application or library with the TestCocoon coverage tool, do `CONFIG+=testcocoon' in the application .pro file. To instrument Qt itself with testcocoon, use the `-testcocoon' configure option. Change-Id: Ie77109a078d11ea51f7a073621e0df9c752c44ae Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make QTest::qWait() handle DeferredDelete eventCharles Yin2011-11-151-0/+2
| | | | | | | | | | | The QTest::qWait() function does not handle DeferredDelete, in this case all deleteLater() calls before the qWait() won't be processed during the wait. Add an explicit sendPostedEvents(0, QEvent::DeferredDelete) to fix this problem. Task-number:QTBUG-22633 Change-Id: I2c5574b4e7d3c070fad6382dc36ddfd1dfac50d6 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Propagate QTest::mouseEvent keyboard modifiers.Andrew den Exter2011-11-101-7/+7
| | | | | | | | | The QWindowSystemInterface mouse functions now have keyboard modifiers parameter, make use of them. Task-number: QTBUG-21743 Change-Id: I65ba1095825b81d575d314c1de2a45cef28e697a Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Prevent timestamps in widgets' touch events from disappearingLaszlo Agocs2011-11-041-2/+3
| | | | | Change-Id: I096914eb2b02ad9c4a5c0462a1f4b76ef17c3957 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added -datatags option to QTestLibJo Asplin2011-11-043-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Note: This feature is ported from Qt 4.8. See the following commits: 01575deafb7d26ca2431374e92c6d71de96547c7 4866d1ba8afbab61e102942d1ea93b81fea053d6 ) Passing the -datatags option to a QTestLib program prints the available data tags to standard output. For completeness, the test case name is also printed at the start of each output line. (Although the file name is supposed to match the lower-case version of the test case name, this is currently not true in all cases (particularly not under tests/benchmarks/). Even if there was a script to enforce this convention, the -datatags option provides this information in a reliable way.) Data tags for each test function (f() in this case) are printed in four different ways depending on the presence of local and global data tags: Case 1: No tags: tst_MyTestCasetst_MyTestCase f Case 2: Local tags only: tst_MyTestCase f local tag 1 tst_MyTestCase f local tag 2 ... Case 3: Global tags only: tst_MyTestCase f __global__ global tag 1 tst_MyTestCase f __global__ global tag 2 ... Case 4: Local and global tags: tst_MyTestCase f local tag 1 __global__ global tag 1 tst_MyTestCase f local tag 2 __global__ global tag 1 ... tst_MyTestCase f local tag 1 __global__ global tag 2 tst_MyTestCase f local tag 2 __global__ global tag 2 ... ... Note that the string __global__ is assumed to be highly unlikely to occur in a data tag (if it does, an ambiguity results). Change-Id: Ib51aa0c3c32ad52e52ce519729292cf8f0ec5d50 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Fix getting of enviroment strings in testlibJason McDonald2011-11-031-5/+5
| | | | | | | | | | | | | | | | | | | The standard C getenv() returns NULL if the requested environment variable is not found. In Qt4 and later, qgetenv() does not return a null pointer if the requested environment string is not defined. Instead it returns a QByteArray containing an empty string. If using qgetenv(), there is no way to tell the difference between an undefined environment variable and one which is defined to be the empty string. In testlib, all calls to qgetenv() were checking whether the returned QByteArray's constData() returned a null pointer, but that would never happen. These calls must instead check whether the QByteArray contains a non-empty string. Change-Id: I342f0e8b196896c26cccce3ff169fa1b9669b5ff Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Testlib: Remove remains of qpa.Friedemann Kleint2011-11-021-4/+4
| | | | | | | | Link ApplicationServices in the non-qpa case (CoreServices present). Change-Id: I7555243aa480a7a4db84731a797924a97bf200cd Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Correctly handle null windows or widgets in keyClick()Lars Knoll2011-10-311-0/+11
| | | | | | | | | | Allow passing of null windows or widgets to keyClick(). In that case route the event through the normal Qt event processing. This allows e.g. shortcuts to catch the key event. Change-Id: Ic9455ea9be5164918b1c0bccbd58dd32eae74ff1 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update qmltest usage helpCharles Yin2011-10-281-2/+3
| | | | | | | | Add "-translation" command line option Task-number:QTBUG-22390 Change-Id: I0600b92767b73ccb54e8d70f6c7bb8bf8075c81c Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix compiler warnings.Friedemann Kleint2011-10-271-2/+2
| | | | | | | | - Fix gcc 4.6.X warnings about assigned but unused variables - Remove trailing ';' from inline functions (Clang) Change-Id: I8670afd6b149748a740f22c65de137762e9f18e1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Allow commiting and then reusing a QTouchEventSequence for testing.Michael Brasser2011-10-241-20/+33
| | | | | | | | | | | | | This method allows calls to stationary() to automatically remember the previous position for a given touch point id. Example usage: QTouchEventSequence sequence = QTest::touchEvent(&window); sequence.press(0, QPoint(10,10)).commit(); sequence.stationary(0).press(1, QPoint(40,10)).commit(); Task-number: QTBUG-22057 Change-Id: I489ab3d61f4637d2ed97d09ed0854afa814407a1 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>