summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing '\n' in qFormatLogMessage outputKai Koehne2014-10-271-1/+0
| | | | | | | | | | | | | | | Do not automatically add a \n to all messages formatted by qFormatLogMessage. Some backends require a final newline, some don't, so it's best to only append it where it's actually needed. The returned string will be null if the pattern is empty. This allows to differentiate between the case that the pattern just didn't apply (empty line is printed), and the case that qSetMessagePattern(QString()) have been called (nothing is printed). Change-Id: I17fde997a4074f58f82de6dea129948155c322d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Indicate that QTestLib is runningMorten Johan Sørvig2014-10-241-0/+1
| | | | | | | | | | | Set QT_QTESTLIB_RUNNING=1 on QTestLib startup. This allows Qt to adapt its behavior to the testing environment, WHICH IS NORMALLY NOT SOMETHING YOU WANT TO DO. Use with caution. Change-Id: I31de80e7c2cc91ff1ed8137926e6b729ef6efdc6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QTestLib: Remove valgrind version check.Friedemann Kleint2014-10-151-21/+3
| | | | | | | | | Version 3.3 is now assumed to be widely available. Task-number: QTBUG-41453 Change-Id: I453ce26d170b2bbb8179ddf4b91155ddd3e6379a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Removing a few unneeded "? true : false"Alessandro Portale2014-10-091-1/+1
| | | | | | | Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-2/+2
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use title case in section1 titlesNico Vertriest2014-09-301-1/+1
| | | | | | | | Using Python script title-cased.py Task-number: QTBUG-41250 Change-Id: I00d3d7a0b30db7304a7904efd6d63abd9a7b493b Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Update the detection of when to log to stderrThiago Macieira2014-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the detection changes only by inserting the use of the environment variable before the existing tests and removing the check on stderr. This commit adds logic similar to Windows's: if the application has a controlling TTY, we'll use stderr. Otherwise, we'll use the system log. This is technically a change in behavior: previously, we would always use the system log, unless the environment variable told us not to. In practice, the behavior doesn't really change: Android and BlackBerry and systemd-spawned applications are launched with no controlling TTY, so logging will go to their logging systems. [ChangeLog][Important behavior changes][Logging (including qDebug and qWarning)] Log output will now go to the system log (if support for it was compiled into Qt) if the application has no controlling terminal or console window. Set QT_LOGGING_TO_CONSOLE to 1 to force logging to go to stderr. Task-number: QTCREATORBUG-12564 Change-Id: I043c5c4f47c15f26d4f4a5cf43df466ea38cdbc7 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-2460-1134/+654
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Frederik Gladhorn2014-09-242-1/+2
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-232-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| | * Fix QT_NO_REGULAREXPRESSION buildSérgio Martins2014-08-134-0/+14
| | | | | | | | | | | | | | | Change-Id: Ibf1358733d7c5aa2c14cf46c23a24ba4da14143c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Add * as a valid token to our blacklistingLars Knoll2014-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps to blacklist a test function on all platforms, something that isn't easily possible currently. Adding [testfunction] * to the BLACKLIST file will now blacklist the function on all platforms. Change-Id: I9e1a1daf94caa05408a6b3cd7ea7a3acdc962a43 Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Initialize certain Qt environment variables in testcasesThiago Macieira2014-09-231-0/+6
|/ / | | | | | | | | | | | | | | | | QtTest has its own logging environment, such as XML output, so we don't want to have messages formatted differently than expected or sent to an unexpected place. Change-Id: If665c9d7121267269e5b2063f49468eb2b9b9d08 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Add support for blacklisting test functionsLars Knoll2014-09-2112-9/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to have a finer grained control over the tests we skip in our CI system. This adds a blacklisting mechanism that allows blacklisting individual test functions (or even test data) using a set of predefined matching keys for the operating system and some other relevant variables. QTestlib will search for a file called BLACKLIST in the test directory and parse it if found. The file contains a simple ini style list of functions to blacklist. For details see qtestblacklist.cpp. Change-Id: Id3fae4b264ca99970cbf9f45bfb85fa75c1fd823 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix valgrind support in QTestLib's benchmarkingSimon Hausmann2014-08-221-1/+1
| | | | | | | | | | | | | | | | Valgrind has reached double-digit versions, so the regexp for detecting the version from the string needs to be widened accordingly. Change-Id: Ib95994f96d6b1e94a34bedd1b98525076851984b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | 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>