summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Long live QVersionNumber!Keith Gardner2014-08-092-0/+13
| | | | | | | | | | | | The class provides compare operators, stream operators, and hashing functions. This class aims to be compatible with (but not restricted to) the Semantic Versioning 2.0 standard (semver.org). [ChangeLog][QtCore] Added QVersionNumber class Done-with: Marc Mutz <marc.mutz@kdab.com> Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Add qFormatLogMessage()Kai Koehne2014-07-301-4/+2
| | | | | | | | | | | | | | Export the former qMessageFormatString() as qFormatLogMessage(). This allows custom message handlers to format their messages just like the default message handler, taking qSetMessagePattern() / QT_MESSAGE_PATTERN into account. The method should arguably not add the '\n' at the end, which a follow up commit will fix. Change-Id: Ib2a9cfda91473df079daf03bf3197e6ac63e013e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Fix accessibility test code to copy events also based on interfacesFrederik Gladhorn2014-07-231-9/+42
| | | | | | | | | | The previous code assumed that all events would have an object sent along with them. QtWebEngine breaks this assumption and the rest of the code is ready for the change, but using QTestAccesssible was not possible due to this. Change-Id: Idee21caf3076fbffd02d5e728f0c9cabf8712408 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-101-0/+7
|\ | | | | | | Change-Id: Ia12ffdb27ecdf25c2a2bdb0eed1945387502108a
| * Support getting test data from qrcEskil Abrahamsen Blomfeldt2014-07-081-0/+7
| | | | | | | | | | | | | | | | | | | | If none of the other locations work, we can fall back to bundling the test data in qrc to make it possible to include test data on platforms that do not have any good way of deploying files to the traditional file system, like Android. Change-Id: I7779ce6be2380d551697cecfb9f76652d1fd0a38 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Doc: Removed "url" variable from qdocconf files.Jerome Pasion2014-07-041-1/+0
| | | | | | | | | | | | | | | | url is set in qtbase/doc/global which is inherited by the Qt 5 module qdocconf files. Change-Id: Ieffa174f598f4a3b8ce8be9bfae7ca9b6981f12b Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Remove an useless assert.Jędrzej Nowacki2014-06-251-1/+0
| | | | | | | | | | Change-Id: Icf6f6234d6f090fe4928830783620e7255362293 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove unused private method from QSignalSpy.Jędrzej Nowacki2014-06-251-5/+0
| | | | | | | | | | Change-Id: I0b401b2f18aef573a63d77702dd78bd4469d9475 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Avoid extensive string lookup in QSignalSpy.Jędrzej Nowacki2014-06-251-5/+4
| | | | | | | | | | Change-Id: Ie676ad36033e2f8d9832313956cfde9179967483 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-05-221-8/+9
|\| | | | | | | Change-Id: Ia36e93771066d8abcf8123dbe2362c5c9d9260fc
| * Fix auto test failure output on QNXBernd Weimer2014-05-191-8/+9
| | | | | | | | | | | | | | | | | | On QNX mbstowcs does not ignore last parameter (max) when first (dest) is NULL. Set it to sufficiently large value to yield proper results on QNX. Other platforms (standard libraries) will ignore this value anyway. Change-Id: Ie4695254d45082e151a052bf16de684af3b1ba1e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix QtTestlib build under QT_NO_REGULAREXPRESSIONGiuseppe D'Angelo2014-05-153-0/+12
| | | | | | | | | | Change-Id: I4458226e814641269062990f272a40ca577bc9db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-131-1/+14
|\| | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp Change-Id: Ibe75603dc8a51769db6550ea3f07bc8d19b0be85
| * Limit the QString pretty outputs to 256 charactersThiago Macieira2014-05-091-1/+14
| | | | | | | | | | Change-Id: I88e71e517827af7d82e3a47d88d40787051ed827 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-132-18/+8
|\| | | | | | | | | | | | | Manually changed enum to LibGL in src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: If34ee6cce3d1d51fb4bb1fdfa59c30389ea0d207
| * Testlib: Fix minor leak and crash when comparing listsStanislav Ionascu2014-05-061-2/+8
| | | | | | | | | | | | | | | | | | | | 1) toString does not track the string it returns, thus it has to be deleted by the caller 2) on some platforms vsnprintf crashes if a null string is in the va_list Change-Id: Iecf94e93d3a2ddf4186ee20de1f495f2f92dcc60 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Remove warnings about sleep times from QTest::qSleep()Ulf Hermann2014-05-061-16/+0
| | | | | | | | | | | | | | | | | | The collected data doesn't reveal any obvious correlation between sleep times and test failures but the many warnings are a hassle for anyone reading the test results. Change-Id: I71bd0c90c20c730573693f23f4435e538b635d44 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-064-14/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp src/opengl/qglpixelbuffer.cpp src/opengl/qglshaderprogram.cpp tests/auto/opengl/qglthreads/tst_qglthreads.cpp Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
| * Improve accessibility event failure outputFrederik Gladhorn2014-04-301-5/+3
| | | | | | | | | | | | | | Simpler code and more information ;) Change-Id: I5ca6b2ee88e51dbbd3ec2f08c4ea79bc11b649fa Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * Remove duplicate symbol name: QTest::currentAppNameThiago Macieira2014-04-301-4/+4
| | | | | | | | | | | | | | | | | | | | It's declared in qtestcase.h as a function, so let's not declare the one in qtestresult.cpp as a static variable. None of the variables in qtestresult.cpp need to be in the QTest namespace, but we don't need to change them now. Change-Id: If6cc34642fdfe3ccda3b8cea7d053ead0db9ccbd Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Doc: add info about the -perf benchmark switch to QtTest's manualThiago Macieira2014-04-291-3/+16
| | | | | | | | | | Change-Id: I923dcf4f59db8281800950684fdd6dcc6715508e Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Check the right object's height in qCompare for QImage and QPixmap.Gunnar Sletta2014-04-281-2/+2
| | | | | | | | | | | | | | Fixes http://www.viva64.com/en/b/0251/, Typo No. 3 and 4 Change-Id: Icbd33534dbf424e00e4c351ae5ee0e3daa99e7b9 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | QSignalSpy: Added template function pointer constructorKeith Gardner2014-04-233-0/+61
| | | | | | | | | | | | | | | | | | Added the function pointer constructor to QSignalSpy to take advantage of the new connect syntax. Change-Id: I94218a096c677cdba73e1b2cfa8b9c09bc28145f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-04-112-8/+13
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-armv7le-qcc/qplatformdefs.h src/printsupport/kernel/qcups.cpp src/widgets/styles/qstyle.h tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp Change-Id: Ia41e13051169a6d4a8a1267548e7d47b859bb267
| * QTestCase: fix macros taking expressions to avoid clang warningsShawn Rutledge2014-04-081-7/+7
| | | | | | | | | | | | | | | | | | | | They were of the form "warning: using the result of an assignment as a condition without parentheses [-Wparentheses]" Change-Id: I049bf0f67073bf41310ca5ee73f17e5e69de569f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Increase tolerance for warning about QTest::qSleep() for Windows.Friedemann Kleint2014-04-041-1/+6
| | | | | | | | | | | | | | 50% is too strict, it clutters the logs. Change-Id: Ib391064f32e39a1192e77d872cd99b7f95a5065a Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devIikka Eklund2014-04-011-2/+2
|\| | | | | | | Change-Id: I2a6eb9dd7724931bc89f28bcc156e77c4e26d069
| * Doc: Fix warning about nonexistent 'message' parameterSergio Ahumada2014-03-251-2/+2
| | | | | | | | | | Change-Id: I3461f2468ef90452ae7e3830625bf3ed57d22a41 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-03-241-0/+11
|\| | | | | | | | | | | | | Conflicts: src/gui/image/qjpeghandler.cpp Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
| * Warn if the time taken by QTest::qSleep() is more than 50% offUlf Hermann2014-03-171-0/+11
| | | | | | | | | | | | | | | | | | Like this we can find out more easily if autotests fail because of flaky timing. Change-Id: I57b10f5fc4908bed7d00990641b2ddfd4ea84a11 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-282-14/+219
|\| | | | | | | | | | | | | Conflicts: src/network/access/qhttpthreaddelegate.cpp Change-Id: Ia15372687c93cd585967b006c0baaac3a5f29e91
| * QtTest: Don't crash when -callgrind is used on QTEST_APPLESS_MAINThiago Macieira2014-02-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | If there's no qApp, then QCoreApplication::arguments() returns an empty list (after printing a warning). That means the callgrind runner can't get the arguments it needs in order to rerun the benchmark. The crash happens because it always uses .at(0) to try and get the executable's path. Even if we get the path from somewhere else, we still need the arguments. Change-Id: I5c74af4d96fc5824b2b7fd7a89648d78393016e2 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
| * Doc: Address some "No documentation for..." warnings in QTestJason McDonald2014-02-222-14/+216
| | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I811b4711edc3420911fcd706ecef2d090f41bc89 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* | Use new QLibraryInfo::build() in testlib to log build information.Friedemann Kleint2014-02-273-6/+33
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This produces: ********* Start testing of tst_QtJson ********* Config: Using QtTest library 5.3.0, Qt 5.3.0 (Feb 13 2014, GCC 4.6.3, 64 bit, debug build) PASS : tst_QtJson::initTestCase() <?xml version="1.0" encoding="UTF-8"?> <TestCase name="tst_QtJson"> <Environment> <QtVersion>5.3.0</QtVersion> <QtBuild>Qt 5.3.0 (Feb 13 2014, GCC 4.6.3, 64 bit, debug build)</QtBuild> <QTestVersion>5.3.0</QTestVersion> </Environment> <?xml version="1.0" encoding="UTF-8" ?> <testsuite errors="1" failures="1" tests="42" name="tst_QtJson"> <properties> <property value="5.3.0" name="QTestVersion"/> <property value="5.3.0" name="QtVersion"/> <property value="Qt 5.3.0 (Feb 13 2014, GCC 4.6.3, 64 bit, debug build)" name="QtBuild"/> </properties> <Environment> <QtVersion>5.3.0</QtVersion> <QtBuild>Qt 5.3.0 (Feb 13 2014, GCC 4.6.3, 64 bit, debug build)</QtBuild> <QTestVersion>5.3.0</QTestVersion> </Environment> [ChangeLog][QtTest] Tests now output build information. Change-Id: I0ab473371575f2b807db725256805b8bffea3454 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Make the printing of complex Unicode in a QString prettierThiago Macieira2014-02-163-11/+72
| | | | | | | | | | | | | | | This also has the advantage of not requiring the use of the locale codec. Quite an advantage if you're debugging the locale codec. But it's mostly so that we don't get question marks that hide the difference we were trying to locate. [ChangeLog][QtTest] QtTest now prints an escaped version of QStrings that failed to compare with QCOMPARE. That is, instead of converting non-printable characters to question marks, QtTest will print the Unicode representation of the character in question. Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a CSV logging feature to the benchlibThiago Macieira2014-02-147-3/+202
| | | | | | | | | | | | | | | This is only useful for logging benchmarks, since it won't print test passes, failures, etc. It's useful for importing to spreadsheets to do number-crunching. [ChangeLog][QtTest]Added a CSV logging mode that is suitable for importing benchmark results into spreadsheets. This can be enabled by the -csv option on the command-line. The CSV logging mode will not print test failures, debug messages, warnings, etc. Change-Id: I245d6f86bb380645c9bc0d748cf474b3ed42cab8 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-074-5/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * Doc: corrected link/example errorsNico Vertriest2014-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | Update pro files after move gestures folder Update snippet statements Corrected path in imagegestures.pro Task-number: QTBUG-34749 Change-Id: Icc19908914e36507e412ab63bf0cc2809aa48e17 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Revert "Fix mix of new[] / malloc in QTest::toHexRepresentation"Thiago Macieira2014-01-231-3/+4
| | | | | | | | | | | | | | | | This reverts commit e8f73d656cf13d440a3a83980e05c6b117489e40. The original was correct: qtestcase.cpp:282 and 283 use delete[]. Change-Id: I668e17f500edcf9f1406553a160f6f5518dee148 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Doc: corrected broken linksNico Vertriest2014-01-232-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Links fixed: Extra Filters Basic Tools blockingfortuneclient Thread Support Drag and drop examples qBinaryFind qmake common project types imagegestures Task-number: QTBUG-34749 Change-Id: Ib93dda00716dc596db327fee5b97e110a9f27fa7 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Fix the alignment for non-ASCII stringsThiago Macieira2014-01-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d040681b6f3d03b349e9b9487fe89a611d03ee3c added support for aligning the test results for easier side-by-side comparison of the actual and expected values. However, it didn't take into account multibyte strings. That is, we would see: FAIL! tst_testcase::testcase: Compared values are not the same Actual (QString("é")): F0O Expected (expected) : FOO We use mbstowcs (multibyte string to wide char string) that calculates the length in wide chars of the output string. That's roughly equivalent to QString::fromLocal8Bit(string).toUcs4().size(). Change-Id: Ic2649951c50e05143da32a7fbef00a01e385c542 Reviewed-by: Jason McDonald <macadder1@gmail.com>
| * Fix mix of new[] / malloc in QTest::toHexRepresentationThiago Macieira2014-01-221-4/+3
| | | | | | | | | | | | | | | | | | toHexRepresentation is used in QTest::toString(), whose results are deallocated with free(). So we shouldn't allocate with new[]. Change-Id: I3e9d35b3f28a1b9bfe740a13b5daa414b67853c6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-01-213-8/+16
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-203-8/+16
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
| | * Fix QtTest function-unused warnings found by Clang 3.4Thiago Macieira2014-01-172-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | The front-end functions in the QTest namespace are declared static inline, so the compiler can complain. Make it not do so. Change-Id: I4036c85010e02ef22a8071ed05e49173dfc64729 Reviewed-by: Jason McDonald <macadder1@gmail.com>
| | * Windows: Do not print test output to both stdout and system debug logKai Koehne2014-01-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid piping the test output to both the Windows system debugger, and stdout. This fixes duplicate output in Qt Creator, which displays messages from both sources. [ChangeLog][QtTestLib] The (default) plain text logger on Windows now logs to either the system debug log (in case no console is open), or stdout, not both. Task-number: QTBUG-34630 Change-Id: I35fe9f4a50cc660d79fad7dffa6d19659b2102ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | | Testlib: Use QString for messages in QAbstractTestLogger::addMessage()Friedemann Kleint2014-01-218-27/+25
|/ / | | | | | | | | | | | | | | Task-number: QTBUG-35743 [ChangeLog][QtTest][Windows] Use correct UTF-8 encoding for XML test results on platforms with different console encoding. Change-Id: Ice9d03192098f931e5dac358928e0c4421ab715e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Extend QTRY_COMPARE and QTRY_VERIFY macrosJędrzej Nowacki2014-01-131-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to fix CI, one of the most common complains is that CI machines are overloaded and some tests simply timeouts. This patch extends QTRY* macros to gather statistics. Each time a QTRY* macro is used it is waiting for the expression to be true by certain time (by default 5 sec) Next, if it failed, it waits twice as much to prove that the expression is not affected by CI machine slowness, then fails anyway. Before the next major release, we should decide if this functionality should be included, as it changes behavior slightly. The following task should be kept open until the decision has been made: Task-number: QTBUG-36036 Change-Id: I7ab5070cb7eb7d96a7289dd7b2bebf91d93090e5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | Testlib: Add test duration to xml outputFrederik Gladhorn2014-01-132-1/+18
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtTest] Added test duration to xml output. When running tests with xml output a new tag of the form <duration msecs="123"/> is added to each test function and the test as a whole. Change-Id: Ibc4db066b6acf5fac6c578f5e5ca5ce4b5d8ea8e Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-102-10/+17
|\| | | | | | | Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e