summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* src/testlib/testlib.pro: add missing qbenchmarksmetric.hMarc Mutz2015-01-191-0/+1
| | | | | Change-Id: I9b879bb22f3e3f74e55234730d9cf79221812a36 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* QBenchmarkResult: fix uninitialized valueMarc Mutz2015-01-191-0/+1
| | | | | | | | | | | | | | This manifested itself in a UBSan report about loading a non-enumerated value from an enumeration variable: src/testlib/qbenchmark_p.h:95:7: runtime error: load of value 11091, which is not a valid value for type 'QBenchmarkMetric' (or similar). The chosen value is simply QTest::QBenchmarkMetric(0). Change-Id: I8492a871a71d89fa6f7902d38f9eecee4b060646 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Autotest: Selftests fail in UTC timezoneRainer Keller2015-01-191-2/+1
| | | | | | | | | | | Selftests for testlib fail when executed in UTC timezone because local and UTC are the same, but expected to be different. A custom timezone is used instead. Debug output of qCompare does only handle local and non-local timezones, using new Qt5 features allows to show the correct timezone in format string. Change-Id: I753884a12370952b7b62a90d62896db4f2d3d1b4 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Also search current directory in QFINDTESTDATAEskil Abrahamsen Blomfeldt2014-12-191-0/+7
| | | | | | | | | | | | On Android, none of the file system paths used for QFINDTESTDATA currently are suitable. We do have the possibility of putting test data in qrc, but in cases where the test is specifically testing access to the regular file system, we need a way to find files there as well. We add a fifth step when all other fail, which searches the current active directory for the data. Change-Id: I4f02f8530b5843eb282bd112ea03ed6a476593d6 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* QtTest: fix pretty-printing of QStrings containing "Thiago Macieira2014-11-211-1/+1
| | | | | | | It needs to be escaped with a backslash. Change-Id: Idf62914fca08eb6be8a039c2af72bac42c0d594a Reviewed-by: Jason McDonald <macadder1@gmail.com>
* WinRT: Ignore winrtrunner specific argumentsMaurice Kalinowski2014-11-211-1/+2
| | | | | | | | | | qdevel is an option used from winrtrunner to indicate a specific environment to the app. QTestLib needs to ignore that parameter similar to the Visual Studio generated arguments. Change-Id: I00a3abe19f1e5b4159e65d26050f04e28f40316f Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
* Make QVersionNumber privateThiago Macieira2014-11-132-13/+0
| | | | | | | | | | We're not ready. [ChangeLog][EDITORIAL] Remove all mentions of QVersionNumber. Change-Id: I03ad95992982eb3177f982c1eeddb6a6bc29336c Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QTestEventLoop::exitLoop() thread-safeRoland Winklmeier2014-10-311-0/+7
| | | | | | | | | | | | | | | | | | | QTestEventLoop::exitLoop() is used by QSignalSpy to stop event processing when the connected signal has been received. The design of QSignalSpy requires QTestEventLoop::exitLoop() to be thread-safe, which it wasn't. When QSignalSpy is connected to a signal in a different thread, exitLoop() was called from the thread which emitted the signal and not the one in which QTestEventLoop is running. This caused troubles when killing the internal timer. This patch adds a check in the beginning of exitLoop(). If it is called from a different thread, it will post an event into the message queue in which QTestEventLoop is running and execute it there. Change-Id: Icb8c8ff2f5344800ee6c6125b98c677c7a196c32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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