summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin
Commit message (Collapse)AuthorAgeFilesLines
* Fix warning when comparing qsizetype to result of sizeofTor Arne Vestbø2020-07-261-1/+1
| | | | | | | warning: comparison of integers of different signs: 'qsizetype' (aka 'long long') and 'unsigned long' Change-Id: I03acb1f7aed782169a0a42cd8afc84b85991cd1e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QPluginLoader: Fix MachO stub testsTor Arne Vestbø2020-07-222-5/+12
| | | | | | | | | The -arch_blank argument to lipo is no longer supported. Pick-to: 5.15 Pick-to: 5.12 Change-Id: I47efcb3633f23b7a18d66211bc16d5c9dbc067c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-0921-48/+46
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-2/+2
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in corelib testsJarek Kobus2020-07-071-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic80fde5517aed363f17d0da55cadcc958c3c8895 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Skip / ignore failing tests on CMake platformsAlexandru Croitor2020-07-012-1/+19
| | | | | | | | | | | | | Skip crashing tests and ignore failing tests on CMake platforms. Add missing QTEST_ENVIRONMENT=ci env var assignment to Coin test instructions. This was hardcoded by the Coin code for qmake configurations. Task-number: QTBUG-85364 Change-Id: Id2312e504a0d36b8f8596d4cebaa49c63731406e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix failing plugin tests on MinGWAlexandru Croitor2020-06-093-0/+19
| | | | | | | | | | | MinGW plugins should not have the lib prefix in the shared library names. Do this manually for a couple of libraries, and also for the generic qt_add_cmake_library function. Amends 9b0e23ef8a915a8c58808fa356f771ecdb6f020c Change-Id: I1cfaf8fc046f86edd3e755adfa599aa0aa854ee3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove winrtOliver Wolff2020-06-0612-60/+3
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Fix tst_quuid to pass on macOSAlexandru Croitor2020-06-042-1/+17
| | | | | | | | The helper executable needs to be a bundle, because that's what the test expects. Change-Id: I7c3f72f12b7a744478b4832685d032abfc679e5b Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Change qHash() to work with size_t instead of uintLars Knoll2020-04-091-1/+1
| | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Simon Hausmann2020-03-161-1/+1
|\
| * Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-161-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-111-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary.cpp src/corelib/plugin/qlibrary_unix.cpp src/corelib/plugin/qpluginloader.cpp Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
| | | * QLibrary: stop setting errorString after resolve()Thiago Macieira2020-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolve() is technically thread-safe if the library has been loadaed. We don't promise that, but it's there. More importantly, because QLibraryPrivate is shared among QPluginLoader and QLibrary that point to the same file, we can't thread-safely set the error string. [ChangeLog][Important Behavior Changes] QLibrary::resolve() will no longer set or clear the error string based on the success of finding the symbol. The error string will reflect the result of loading the library. Change-Id: I46bf1f65e8db46afbde5fffd15e1a4f4c2713c17 Reviewed-by: David Faure <david.faure@kdab.com>
* | | | cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | cmake: Fix naming when referring to Apple macOSTor Arne Vestbø2020-03-161-1/+1
|/ / / | | | | | | | | | | | | Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: Fix tst_pluginLeander Beernaert2020-02-202-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not possible to exclude targets based on the build configuration in CMake. loadDebugPlugin() and loadReleasePlugin() will always fail as both debug and release plugins are built regardless of the build configuration. This patch adds the CMAKE_BUILD define and skips the opposite test on Windows. E.g.: With config = Debug, the loadReleasePlugin() test is skipped and viceversa. Change-Id: I2659882604bb39eb11d3e9e2b2b37a2972475285 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-123-5/+3
| | | | | | | | | | | | | | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-1/+1
|\| | | | | | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * | Avoid initializing QFlags with 0 or nullptr in testsFriedemann Kleint2019-11-261-1/+1
| |/ | | | | | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Change-Id: Ib5d17611e43e7ab2c63c7f0587f549377f262e32 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Regenerate TestsLeander Beernaert2020-01-166-3/+6
| | | | | | | | | | | | Change-Id: I78f1efbec809610bcf6a8224392fa0dc8dbf3b3b Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* | Distinguish between qt_plugin and regular pluginsLeander Beernaert2019-10-2817-35/+290
| | | | | | | | | | | | | | | | | | If we do not encounter the load(qt_plugin) statement in the .pro file but we do see the entry CONFIG+=plugin, treat the target as a regular CMake library instead of treating it as a qt_plugin by default. Change-Id: I67ad5c865a1a5ab691a6b0d86c2db4b686aa04dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Convert corelib plugin testsLeander Beernaert2019-10-2125-0/+695
|/ | | | | Change-Id: Ia98f7945a2c5b09a9b4d59e430cf05a7fecb7d55 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Disable debug-and-release builds for MinGWSimon Hausmann2019-09-184-7/+13
| | | | | | | | | | | | | | | | | | | | | The requirement to separate debug and release DLLs on Windows stems from the Visual Studio C run-time library appearing in two different variants (debug and release) and not mixing well. It's possible to perform builds without optimzations and with debug symbols while linking against the release version of the C run-time, but at the same time the debug version of the run-time brings other developer visible advantages. MinGW on the other hand does not have this distinction, does not ship with separate DLLS and does also not require the VS C runtime library. Therefore we do not need this separation for MinGW, which means that our packages can be reduced in size and application developers wishing to debug their applications do not have to use debug builds of the Qt libraries or run into Qt internal debug code. Task-number: QTBUG-78445 Change-Id: Idf588606091298dc44262c4c89e689df18d34747 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-051-1/+2
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/generators/makefile.cpp Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
| * QPluginLoader: fix failing test comparing the Qt versionThiago Macieira2019-07-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | We stopped storing the patch release number of Qt in the plugin metadata in commit 7bd79b3cffbbbece23867c5e111a3dd2ebcad016 (5.13), to make it simpler to parse the validity of plugins before decoding the CBOR payload. Fixes: QTBUG-76855 Change-Id: I6aed4df6a12e43c3ac8efffd15adbbf83e928866 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-271-6/+13
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/network/ssl/qsslsocket_openssl.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
| * Skip tests if the required plugins were not deployedVolker Hilsheimer2019-06-191-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This is usually the case on Android, where running this test would require deployment of files to the emulator. This doesn't give us any further testing that we don't already do by running this test on regular Linux, so skipping the test instead if the preconditions aren't met. Change-Id: I3722796634871213ba51c89ae7f40b19f954f2cb Fixes: QTBUG-73566 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | test: migrate QLibrary test to QRegularExpressionSamuel Gaist2019-06-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. Task-number: QTBUG-72587 Change-Id: I60ffa6df83aaf520730cfbb1dd3f18a2d2e19977 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | moc: Add a standard way of specifying a URI as part of Q_PLUGIN_METADATAUlf Hermann2019-04-112-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | Usually, when you load a plugin, you don't want to load just any plugin that fulfills a given interface, but rather a specific one. When loading dynamic plugins you can differentiate the plugins by file name. This doesn't work in the static case, and file names are also separate from the plugin metadata shipped inside the plugin files. To solve this problem, different hacks have been developed in various places. QML extension plugins add a special property "uri" via the -M option of moc, QML debug plugins expect you to add a json file with an array of "Keys", Qt Creator plugins have a "Name" in their json files, etc. By allowing the identifier for the plugin to be specified inline with the metadata declaration we can make many of the above workarounds obsolete and provide a clean way for users to find their plugins. Task-number: QTBUG-74775 Change-Id: Ie2af16c49d4c5aa5a77fab0fae1e0a4449bd7a39 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-03-061-1/+1
|\ | | | | | | | | | | | | Conflicts: src/network/access/http2/hpacktable_p.h Change-Id: Ie0c296667dfdebba84f4858056a1ac80c24ee7df
| * Fix build with -no-gui on macOSAlex Richardson2019-03-041-1/+1
| | | | | | | | | | | | | | | | | | Some directories that depend on QtGui were being included without the appropriate check for qtHaveModule(gui). Change-Id: I7c348c74464d44cbd35a027f188f8a23bb2021d9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-046-61/+80
|\| | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
| * Avoid invalid qmake code in macOS-specific pluginloader testUlf Hermann2018-11-306-61/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | You cannot manipulate variables in custom target dependencies, so the following code was invalid: i386_d.depends = EXPORT_VALID_ARCHS=i386 In order to still build the fat binary, we split the project in four, one for each architecture, plus one to create the final package. Change-Id: If08cf54e2e4098a7e10df41b7ea8d2bf699f58be Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-273-3/+3
|\| | | | | | | Change-Id: I04afffdce6b78856d0301eb583f21d334c7466b0
| * Use msvc qmake scope where appropriateJoerg Bornemann2018-11-223-3/+3
| | | | | | | | | | | | | | | | | | Use 'msvc' instead of 'win32-msvc' or even 'win32-mscv*'. Change-Id: I21dc7748a4019119066aea0a88a29a61827f9429 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-113-1/+26
|\| | | | | | | Change-Id: I1df9adea124326ef7c7802839eb93efc4302b287
| * moc: Fix compilation of text strings containing non-ASCIIThiago Macieira2018-09-103-1/+26
| | | | | | | | | | | | | | | | | | | | | | On platforms where char is signed, like x86, the following is an error (narrowing conversion): unsigned char x[] = { '\xc3' }; Change-Id: I495bc19409f348069f5bfffd15518f9ef4e43faf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-022-8/+58
|\| | | | | | | Change-Id: I33e0abc771a2a772d3334172d50e7b0efe896590
| * Plugins: Save some architectural requirement flagsThiago Macieira2018-09-011-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...not just the debug flag. The information is saved outside of the CBOR map for two reasons: 1) removing the hack that depended on how QCborStreamWriter and TinyCBOR internally work, allowing for the extra parameter to be written directly. We wouldn't be able to use that hack anyway and would have needed a further, uglier hack to encode a byte whose value we don't know. 2) outside the map, this information can be parsed more quickly and then we can discard any plugins we shouldn't actually load. Since we're doing this for a flag, I decided to move the Qt version there too for reason #2. Change-Id: I61ecce6b1324410bbab4fffd153d4e5fc696d19e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Plugins: store the metadata in CBOR instead of binary JSONThiago Macieira2018-09-012-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for Qt 6 deprecating the binary JSON format. Also reduces the size of the metadata a little: for the xcb platform plugin, it went down from 264 bytes to 138; for the jpeg image plugin, it went from 320 to 135. I've had to change the signature so older versions of Qt won't try to parse the CBOR data as Binary JSON. Unfortunately, before QJsonDocument could get a chance to reject it, qJsonFromRawLibraryMetaData() needed to allocate memory and that causes crashes with Qt < 5.11.2. Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bee34e16ce347 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QPluginLoader: pave the way for Qt 6 plugin meta dataThiago Macieira2018-08-216-1/+91
|/ | | | | | | We want to store the metadata size and get it from the plugin in Qt 6. Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bebc2914d9a3c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Enable QPluginLoader test for static buildsSimon Hausmann2018-08-032-2/+32
| | | | | | | | | | | The majority of tests use QPluginLoader::setFileName implicitly, which refuses to do any work in static builds. Therefore the majority of tests are skipped. But in the future we'll get tests here that for example use QPluginLoader::staticPlugins() and for that we want to include the sub-directory in the build and test run. Change-Id: Ib8ec274e22ac8050feaca8967eb8626b53876b92 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_qpluginloader: Fix preprocessor conditionOliver Wolff2018-07-271-1/+1
| | | | | Change-Id: Icb7767cb6b0e091a21196518d3908a810970592a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_qplugin: Re-enable loadReleasePlugin test caseOliver Wolff2018-07-261-0/+1
| | | | | | | Change-Id: I678a8748ac757ae2918dd80e4a6d802d7de7b0b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Skip qplugin auto test for static configurationsOliver Wolff2018-07-261-0/+1
| | | | | | | | | | | All test cases use QPluginLoader which will not work for static builds of Qt. Change-Id: I7dcddcd5213681bd3ae4cd85e49ee0bb5748f687 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Plugins: fix crash if the binary JSON data contains invalid sizeThiago Macieira2018-07-194-2/+163
| | | | | | | | | | | | | | Eight bytes into the Binary JSON header there's a 32-bit little-endian size, which qJsonFromRawLibraryMetaData uses to determine the size of the stored metadata. That value is passed as a size to QByteArray, which means certain values could cause crashes due to being too big or via sign-extension in 64-bit. [ChangeLog][QtCore][QPluginLoader] Fixed an issue that could cause a crash when certain damaged or corrupt plugin files were scanned. Change-Id: I117816bf0f5e469b8d34fffd153dc5425cec39a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QPluginLoader: limit the amount of memory used when scanning pluginsThiago Macieira2018-07-141-2/+2
| | | | | | | | | | | | | | | | | | | When using actual memory allocation, limit to 64 MB, not the full file size. On most systems, the memory map technique will work, so this won't even be tried. In any case, we don't need the fix for the OOM situation that was applied in commit e211ab76d766878b4dbe88901b9a7a4a70ce7332. As for the memory mapping technique, this commit limits the allocation to reasonable values given the virtual memory addressing space. Half a gigabyte is probably acceptable on 32-bit systems, where there should be a contiguous space for the OS to allocate the file in. This commit also fixes an overflow when converting from qint64 of the file size to ulong (32-bit on 32-bit platforms and on Windows). For 64-bit systems, we currently limit to 1 TB. Change-Id: I117816bf0f5e469b8d34fffd153dc1705a8eedc4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Android: Pass tst_QFactoryLoaderMårten Nordheim2018-06-302-0/+19
| | | | | | | | | Similar to the changes made for tst_QLibrary: 0ac09c40f28987169786b3063af423e9fe93c6b8 but even less intrusive. Change-Id: I4bc0ba385e639f07f9b39cf8ba9542c27be8a3ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Pass tst_qlibraryMårten Nordheim2018-06-292-15/+57
| | | | | | | | | | To make the minimum amount of changes: - Extract the library files into the expected hierarchy. - Introduce a variable with the path to the directory. - Make the static function a member function so it can use the variable Change-Id: Ibf3106c3606d198a8deb8cb2a5cbde57207221c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>