summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Q{Plugin,Factory}Loader: downgrade warnings to debug messagesThiago Macieira2023-05-051-4/+0
| | | | | | | | | | | | | | | | Since we don't have different environment variables for the plugin paths, users have to set QT_PLUGIN_PATH to where plugins for both Qt 5 and 6 (and future versions) are located. This causes Qt to print warnings that those couldn't be loaded because the major version mismatches. So don't print them any more. QT_DEBUG_PLUGINS and the category logging filter can still be used to enable them. Fixes: QTBUG-107459 Pick-to: 6.5 Change-Id: Idd5e1bb52be047d7b4fffffd175318ca1f8017bd Reviewed-by: Lars Knoll <lars@knoll.priv.no>
* Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definitionEdward Welbourne2023-03-201-2/+2
| | | | | | | | | | I got tired of being told off by the inanity 'bot for faithfully reflecting existing #if-ery in new #if-ery. Retain only the documentation and definition of the deprecated define. Change-Id: I47f47b76bd239a360f27ae5afe593dfad8746538 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_QPlugin::scanInvalidPlugin(): de-duplicate a data-tagEdward Welbourne2022-10-111-2/+2
| | | | | | Change-Id: Ibc25041b5e003cf21d781012f279e9bdd75a2ee9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Android: activate tst_QPluginIvan Solovev2022-03-251-1/+8
| | | | | | | | | | | | | | | - Use QT_ANDROID_EXTRA_LIBS to correctly deploy libraries on Android. - Update the test code to use the application libraries directory instead of resources on Android. This allows to enable the test for Android in CMakeLists.txt Task-number: QTBUG-87438 Pick-to: 6.3 6.2 Change-Id: I2f6d2d4f3ab3872cf7d7fad1668b5c2c3eef3aad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix test when accessing patched plugin too fastPasi Petäjäjärvi2022-02-251-0/+5
| | | | | | | | | | At least one OS (QNX) can't dlopen() a library that is still open for writing elsewhere Pick-to: 6.2 6.3 Fixes: QTBUG-101020 Change-Id: I84ca709a65fc824ec4b3e3f1ea03704bf1cc0414 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPlugin: update the arch requirements to match the x86-64 ISA levelsThiago Macieira2021-10-041-9/+10
| | | | | | | | | | When we created the functionality, the levels were not yet standardized. Now they are and you can use -march=x86-64-v3 (for example) to get to them. We're making a split between "v1" and "baseline" here for the benefit of 32-bit, which is not included in the ISA levels. Change-Id: I2de1b4dfacd443148279fffd16a397a700b9a15a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPlugin: move some of the logic from moc's output to qplugin.hThiago Macieira2021-10-041-7/+4
| | | | | | | | | | | | | | This will allow us to make changes in QtCore itself, without having to worry about moc compatibility. The output uses an #ifdef so this version of moc can still be used to compile earlier versions of Qt (usually, in cross-compilation environments). See discussion in the mailing list[1]. [1] https://lists.qt-project.org/pipermail/development/2021-September/041732.html Change-Id: I2de1b4dfacd443148279fffd16a39784c80c5f3b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPlugin/QFactoryLoader: remove Qt 5 plugin remnantsThiago Macieira2021-09-141-37/+0
| | | | | | | | | | | Qt 6.x does not need to be able to read the old Qt 5-based binary JSON metadata. The QT_WARNING_DISABLE_DEPRECATED was needed in 5.15 while we used the then-deprecated functions to decode. Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a39ee074da3ef4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Blacklist and skip failing tests on macOS ARMTor Arne Vestbø2021-05-041-0/+3
| | | | | | Task-number: QTQAINFRA-4431 Change-Id: I4ae47bb461634d524995077501b54322f6beccf3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Fix tst_pluginLeander Beernaert2020-02-201-0/+6
| | | | | | | | | | | | | | 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>
* 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>
* 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-011-7/+43
| | | | | | | | | | | | | | | 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>
* 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>
* Plugins: fix crash if the binary JSON data contains invalid sizeThiago Macieira2018-07-191-0/+107
| | | | | | | | | | | | | | 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>
* tests/auto/corelib/plugin: clean upMarc Mutz2016-08-271-3/+4
| | | | | | | | | - port from Q_FOREACH to C++11 range-for Fixes errors reported by my local tree's static checks. Change-Id: Ib8522ed424ba227d84f9664c3282f95f6bee547c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Use new plugin system in plugin autotest.Friedemann Kleint2012-02-231-1/+9
| | | | | | | Fix up test use QFINDTESTDATA for shadow builds. Change-Id: I64731baa44f446ce360631ed6a638cea098d78a0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moving relevant tests to corelib/pluginHolger Ihrig2011-09-011-0/+120
Task-number: QTBUG-21066 Change-Id: I918f6ef6fb825d7cf94d6b42322b2c2eb5c52aaa Reviewed-on: http://codereview.qt.nokia.com/3604 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>