summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* QTest: Make qExtractTestData() return the created QTemporaryDirv5.5.0-rc1Marc Mutz2015-06-142-16/+23
| | | | | | | | | | | | | | | | ... and enable auto-deletion on it. This allows users of the function to get rid of their own cleanup code. They just need to keep the shared pointer alive for as long as they need it. Drive-by changes: - replaced QStringLiterals that were only used as the rhs of op+ - replaced an instance of mid() used as the rhs of op+ with midRef() - enabled NRVO Change-Id: I161d39461e020c9e8d473c0810dea2109fe0d62d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-06-011-0/+3
|\ | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/global/qglobal.h Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
| * Doc: Added the missing \brief and \image for example docsVenugopal Shivashankar2015-05-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | The Qt TestLib examples are just tutorials so updated the qdocconf to use the default thumbnail in the Qt Creator welcome screen. Task-number: QTBUG-41996 Change-Id: Ia04a42a92e414c97a426b6095a62621a348e7de0 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Add GPU_BLACKLIST support to QTestLibLaszlo Agocs2015-05-084-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to BLACKLIST, Qt will now look for GPU_BLACKLIST too. Test cases that are specified as disabled in the GPU blacklist will be skipped. This is particularly relevant when running tests on Embedded Linux devices. For example, the following JSON would configure the test case glxContextWrap to be skipped on drivers where GL_VENDOR contains UnstableDriverVendor: { "entries": [ { "gl_vendor": "UnstableDriverVendor", "features": [ "disable_glxContextWrap" ] } ] } In contrast to the regular blacklist, GPU-blacklisted test cases are not run at all. This is because driver problems and instabilities often lead to crashes. Change-Id: I340cf5c0261a206109b78409774408981bba5c68 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | TestCase: Also check main source path when looking for test dataCaroline Chao2015-05-053-0/+34
| | | | | | | | | | | | | | | | | | | | | | This is for example useful when looking for a possible BLACKLIST file while doing a shadow build. Add autotests for blacklist. Change-Id: I41d3939d31d21d10187fefcb82604736d911b6ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Make data tables const.Volker Krause2015-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | Moves some of them to the .rodata section, the rest at least to .data.rel.ro[.local]. Change-Id: I85676ddf22b0c0097f3f0dce4c3dc018dc29d045 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Remove libs that are already set by the mkspec.Bjoern Breitmeyer2015-04-211-2/+1
| | | | | | | | | | | | Change-Id: I79c47e5a49ce048c634e4bc708b632e51133c027 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Implement a more direct headersclean checkThiago Macieira2015-04-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test each include file directly, instead of doing a large #include. This verifies that each header is compilable on its own. One big advantage of doing it via a special compiler in qmake is that we skip pre-compiled headers, which has hidden build errors in the past. This solution is implemented by making syncqt produce a second list of headers. This list is the same as the list of headers in the source code to be installed, minus the headers that declare themselves to be unclean, via the pragma: #pragma qt_sync_skip_header_check This mechanism is applied only for public libraries (skipping QtPlatformSupport, an internal_module). This test is enabled only for -developer-builds of Qt because it increases the compilation time. On QtTest: the library only links to QtCore, but it has two headers that provide inline-only functionality by including QtGui and QtWidgets headers (namely, qtest_gui.h and qtest_widget.h). If those two modules aren't getting compiled due to -no-gui or -no-widgets to configure, we need to remove the respective headers from the list of headers to be checked. If they are being built, then we need to make QtTest's build wait for the headers to be generated and that happens when qmake is first run inside the src/gui and src/widgets directories. Change-Id: I57d64bd697a92367c8464c073a42e4d142a9a15f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-1/+1
|\| | | | | | | Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
| * Explicitly cast to a uint to fix a compile errorAndy Shaw2015-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | When using QtTest inside the notification example for QtAndroidExtras there as a problem with the compilation as it saw it as being an ambiguous check. Therefore doing an explicit case to uint ensures it is not a problem. Change-Id: Ibc9ce4c64292bf5ae7c501c592d8c42a66934b8b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | testlib: Detect msvc version for blacklistingCaroline Chao2015-04-091-0/+9
| | | | | | | | | | | | | | Check _MSC_VER to detect the msvc version (2010, 2012 or 2013). Change-Id: I96a73d316a6124e38b2c48c5752dfc22357f8d00 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use QT_WARNING_.. instead of #pragma GCC diagnostic ..Konstantin Ritt2015-04-071-3/+4
| | | | | | | | | | Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | testlib: Detect distribution name/release for blacklisting testsCaroline Chao2015-03-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | Add possibility to blacklist distributions using the syntax: "<productType>" and "<productType>-<productVersion>". productType and productVersion are the values returned by QSysInfo::productType() and QSysInfo::productVersion() (in lower case). Change-Id: Iefd948127dd2133c2f2ab7aeb5b0c9749c3df6c5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Add XCTest logger backend to QtTestLibTor Arne Vestbø2015-03-276-2/+643
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Will be active when running test apps through Xcode's 'test' action, and reports QtTestLib test objects and functions to Xcode as XCTest cases. This allows running tests on both iOS Simulator and iOS devices from the command line, through xcodebuild, without relying on any 3rd party tools. It also integrates Qt test failures and passes into the Xcode IDE, which may be useful for closer investigation of test failures. The feature is limited to Xcode 6.x. Change-Id: I33d39edbabdbaebef48d2d0eb7e08a1ffb72c397 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Testlib: Fix cleanupTestCase not called when last test blacklistedRainer Keller2015-03-121-0/+3
| | | | | | | | | | Change-Id: I23810b4bd086c393325e56f7779fe7f7f01e76cf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QTest: Print hex instead of octal for QByteArray QCOMPARE failuresThiago Macieira2015-03-111-6/+25
| | | | | | | | | | Change-Id: Ia0aac2f09e9245339951ffff13c65b2234d01ad0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Fix various qdoc-warnings.Friedemann Kleint2015-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp:1199: warning: Undocumented parameter 'model' in QItemSelectionModel::modelChanged() qtbase/src/corelib/plugin/qpluginloader.cpp:420: warning: Can't link to 'staticPlugin()' qtbase/src/gui/text/qtextdocument.cpp:1452: warning: No such parameter 'from' in QTextDocument::find() qtbase/src/testlib/qtestcase.cpp:2770: warning: No documentation for 'QTest::qExtractTestData()' Change-Id: I76758dbdf3ad7b0ae1f14de0407a6fde523827d0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Replace blog.qt.digia.com with blog.qt.ioSergio Ahumada2015-02-061-2/+2
| | | | | | | | | | | | Change-Id: I7f1c897d8c96780ee330bca18edd9fe893ee7c90 Reviewed-by: Tero Kojo <tero.kojo@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Testlib: Add function to extract files from resources to diskRainer Keller2015-02-182-0/+58
| | | | | | | | | | Change-Id: I7ae1cdfea751a759298cf277e36cfef7a9c46edb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | | | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Updated BSD licensed file headersJani Heikkinen2015-02-156-18/+18
| | | | | | | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Make the printing of complex byte arrays prettierThiago Macieira2015-02-153-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | Similar to what we've done to QString, only we print each byte that is not ASCII as \OOO (octal representation). [ChangeLog][QtTest] QtTest now prints an escaped version of QByteArrays that failed to compare with QCOMPARE, instead of the hex dump. Change-Id: I6a8c43f138c66c998280998a242b43cd579666a0 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Update copyright headersJani Heikkinen2015-02-1173-506/+498
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * src/testlib/testlib.pro: add missing qbenchmarksmetric.hMarc Mutz2015-01-191-0/+1
| | | | | | | | | | Change-Id: I9b879bb22f3e3f74e55234730d9cf79221812a36 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-212-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * 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>
* | qtest_widgets.h: add support for pretty-printing QSizePolicyMarc Mutz2015-01-162-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... in QCOMPAREs. The implementation is hidden in a nested Internal namespace that retrieves the strings without strdup()ing. That makes it easier to compose these functions as there is no need to delete character arrays when using them. The public interface (which qstrdup()s) is implemented on top of these. [ChangeLog][QtTest] QCOMPARE now pretty-prints QSizePolicy{,::Policy,::ControlType{,s}}. Change-Id: Ib03d969847e5a12474c71a7921366b400025f680 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDebug: pretty-print QStrings and QStringRefsThiago Macieira2015-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QDebug] Printing of QStrings and QStringRefs whenever "noquote" is not active now prints the strings in a format that can be copied back to C++ code. All characters that aren't printable in US-ASCII are escaped (this includes printable Unicode characters outside of US-ASCII). Pretty-printing will not respect QTextFormat padding or field widths. Change-Id: I169a8a0508e24693f5652f0129defe7f709e5d08 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add QtInfoMsgKai Koehne2015-01-096-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an 'info' message type that can be used for messages that are neither warnings (QtWarningMsg), nor for debugging only (QtDebugMsg). This is useful mainly for applications that do not have to adhere to the 'do not print anything by default' paradigm that we have for the Qt libraries itself. [ChangeLog][QtCore][Logging] QtInfoMsg got added as a new QtMsgType. Use the new qInfo(), qCInfo() macros to log to it. Change-Id: I810995d63de46c41a9a99a34d37c0d417fa87a05 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | QTest: update docs for toString()Marc Mutz2015-01-082-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | Following c61f8df4047a616ffcb5e775fa8e5981b13e193f, we now prefer overloading toString() in the type's namespace over specializing the primary template. Let the docs reflect that and add an example. Also suggest to delegate the messy raw char pointer handling to the existing toString(QString)/toString(QBA) overloads. Change-Id: Id76181faba86aea52588611ea64ea9b95371a733 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtTest: call toString() as a normal functionMarc Mutz2015-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toString() is both a function template and a set of overloaded functions (for const char* and const void*). So don't explicitly specify the function template arguments (they're deduced from the arguments anyway). This enables overloading toString() as well as specializing the template. [ChangeLog][QtTest][Important Behavior Changes] toString() can now be overloaded (instead of just specialized) for custom types, and is now reliably found through argument-dependent lookup (ADL). Change-Id: Ic4a622d236ad7f0e4142835353f1b98bf2dc6d4c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Document -plugins argument in qmltest usage helpala2015-01-031-0/+2
| | | | | | | | | | | | Change-Id: Ia624fcefe77a456424bcaa00b106ef7f69abb6b9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-0/+7
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * 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>
* | qtest.h: actually include qtest_widgets.hMarc Mutz2014-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Was including qtest_gui.h instead, for QT_WIDGETS_LIB. Not a problem in practice, since qtest_widgets.h doesn't currently add anything on top of qtest_gui.h. But that will change soon. Change-Id: I942870cddc7b1ccfda262e2fe26834594336dd0b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge the different implementations of toHex in one central placeThiago Macieira2014-12-131-12/+9
| | | | | | | | | | | | | | | | | | It's a simple enough function, but we don't need to duplicate those 17 bytes all over the place. Now they'll be duplicated at most once per library. Change-Id: Ic995e2a934b005e7e996e70f2ee644bfa948eb38 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-10/+10
| | | | | | | | | | | | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-244-16/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * 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>
* | Clean up ShortcutOverride handlingFrederik Gladhorn2014-10-301-0/+4
|/ | | | | | | | | | | | | | | Instead of sending the event from random places, send it from QWindowSystemInterface. This allows to send override events on OS X to menus before doing other key processing and reduces the number of ShortcutOverride events on all platforms to exactly one per key press event. Additional test by Friedemann Kleint. Task-number: QTBUG-38986 Change-Id: I6981bb776aba586ebc7c3daa5fd7a0d84c25bc3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@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>