summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin
Commit message (Collapse)AuthorAgeFilesLines
* tst_QFactoryLoader: includemocsMårten Nordheim2024-03-122-0/+4
| | | | | | | | | | | | | For some reason android in CI failed to include the moc file through the mocs_compilation file. It's an issue that needs some investigation, but in the interest of time just include the moc file directly. Pick-to: 6.7 6.6 6.5 Change-Id: I079588598a6f4137ef1fccc482795d703b59bc6e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Correct license for tools filesLucie Gérard2024-03-051-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tools file should be LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Icd5d5be2e04819617e68ff142924de1773bebbad Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Remove extra semi-colonsTasuku Suzuki2024-02-061-1/+1
| | | | | Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change license for tests filesLucie Gérard2024-02-0430-30/+30
| | | | | | | | | | | | 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>
* Resurrect tests/auto/corelib/plugin/qpluginloader/machtestJoerg Bornemann2024-01-104-90/+143
| | | | | | | | | | | | | | | | | | | | | | | | Update the CMake project file to generate the binaries that are to be tested by tst_qpluginloader. Update the tested architectures to arm64 and x86_64 like it was done in 2739aa98b1da164b398a37e6018c205d59debf7e for Qt 5.15. Remove the ppcconverter script that was used to create PowerPC binaries. This architecture is unsupported since ages. Remove the comparison with the pointer size and the alignment check. This isn't valid since commit 2549a88ba2a48fa2bedce97dd71a2974c6f8840a. Remove the magic header check. This is done by the parser itself since commit 3b49aa72fe6ec0dd0aa0c1c41fb81e874dc789fa. Remove the blacklisting of the test. Fixes: QTBUG-86792 Change-Id: Ib7c8e648bdacca6d6290c0f40a3bb02987365fc9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_QUuid: use int128 literals and QCOMPARE supportv6.7.0-beta1Marc Mutz2023-12-091-6/+3
| | | | | | | | | | | | | When the test was written, we didn't have support for either int128 literals or proper QCOMPARE failure printing (QTest::toString()), so the code awkwardly constructed literals from 64-bit ones using arithmetic and QCOMPAREed the high and low 64-bit halves separately. Now that we have added support for both, simplify the test code accordingly. Change-Id: Icdee7bb01f6e4bd3de74233b4fb992b0590ddafd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFactoryLoader: add metaDataKeys() to return just the "Keys" entryThiago Macieira2023-11-281-4/+46
| | | | | | | | | | | | | Without parsing the whole metadata structure into a QCborValue. QFactoryLoader::indexOf() is only used in the icon engine and accessibility loaders. QFactoryLoader::keyMap() has more users, but QFactoryLoader::metaData() is still by far the most used interface. Task-number: QTBUG-114253 Change-Id: I8bd6bb457b9c42218247fffd179753524fc9b6a5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFactoryLoader::instance(): don't fully parse static plugins' dataThiago Macieira2023-11-286-3/+86
| | | | | | | | | | | | | | | | | | | Commit d9766ddc3d525cf08acec4c3483e61d86c9899a8 (Qt 5.12) replaced the use of the old binary JSON format with CBOR, which is more compact and standard, but requires actual parsing instead of just a quick size verification. For regular, loaded plugins, the metadata is stored in parsed QCborValue format, but for static plugins, we were re-parsing each staticplugin's metadata for every single call. This avoids a full parsing and only parses the CBOR header to find the IIDs (moc always outputs the IID first). Fixes: QTBUG-114253 Pick-to: 6.6 Change-Id: I8bd6bb457b9c42218247fffd179750ec6c9e3252 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QFactoryLoader: remove unused member variableMarc Mutz2023-11-131-4/+0
| | | | | | | | | | | | | | | | Commit 862f42e806dce4051fd1a58c6ad2844a45223807 removed the last use of the Android-only `directory` member, but didn't remove the member's definition. Remove it now, probably fixing a Clang -Wunused-private-field warning on Android. Pick-to: 6.6 6.5 6.2 Task-number: QTBUG-87438 Change-Id: I67a1d97f29a0dde20ff29fb9b5bbaa5611cb9e17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QTemporaryFile(Name): don't make the path absolute on generationThiago Macieira2023-10-261-1/+3
| | | | | | | | | | | | | | | | | | I need to use QTemporaryFileName in a context where absolute paths are not allowed because they change the behavior of the system call (the -at() POSIX system calls); see next commit. This required a fix to a seemingly unrelated test, which depended on the absolute path, because QPluginLoader and QLibrary assume a file name with no path components imply "search the standard places". [ChangeLog][Important Behavior Changes][QTemporaryFile] This class will now return relative file paths in fileName() if the file template was also a relative path (it used to always return an absolute path). The temporary files are still created in the same directory; this change only affects the length of the path the function returns. Change-Id: I79e700614d034281bf55fffd178f65f2b3d602d8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUuid: convert bswap(Id128Bytes) to a hidden friend of Id128BytesIvan Solovev2023-08-181-0/+17
| | | | | | | | | | | ... and rename it to qbswap(), thus enabling the endian conversions for Id128bytes via q{To,From}{Little,Big}Endian() functions. Found during Qt 6.6 API Review. Pick-to: 6.6 Change-Id: Ie320cee52ec2b9de0aaa112adec8febb7f5b68a2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove QUuid(quint128) constructor againMarc Mutz2023-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | This constructor matches way too many argument types (integral, unscoped enums, FP types), so it's likely to cause mayhem, even if left in as an explicit constructor. We now have a named constructor for the same functionality, so just drop the "unnamed" constructor. "Unnamed" constructors are important when emplacement is more efficient than construction + move, or when implicit conversion is required. Neither is the case here: The named as well as the "unnamed" constructors just copy ten bytes around, and the compiler can optimize those extra copies away just fine. Found in API review. Pick-to: 6.6 Change-Id: I7faafd3ebf522fb2b0e450112fb95d643fece5ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* tests: port assorted trivial uses of Q_FOREACH to ranged for loopsMarc Mutz2023-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | All of these fall into the trivial category: loops over (readily made) const local containers. As such, they cannot possibly depend on the safety copy that Q_FOREACH performs, so are safe to port as-is to ranged for loops. There may be more where these came from, but these were the ones that stood out as immediately obvious when scanning the 100s of uses in qtbase, so I preferred to directly fix them over white-listing their files with QT_NO_FOREACH (which still may be necessary for some files, as this patch may not port all uses in that file). Pick-to: 6.6 6.5 Task-nubmber: QTBUG-115839 Change-Id: I7b7893bec8254f902660dac24167113aca855029 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Use QT_SUPPORTS_INT128 macro to handle 128-bit integral typesIvan Solovev2023-08-011-1/+1
| | | | | | | | | | | | | | | | | | | Introduce QT_SUPPORTS_INT128 and QT_NO_INT128 marcos to handle 128-bit types. These macros allow to undef Qt's own 128-bit types and the related code, but keep the compiler definitions unchanged. This is required for Qt Bluetooth, where we need to use QT_BLUETOOTH_REMOVED_SINCE to get rid of the APIs using QtBluetooth-specific struct quint128 which clashes with the 128-bit types. The idea is to use QT_NO_INT128 in Qt Bluetooth's removed_api.cpp instead of directly undef'ing __SIZEOF_INT128__, because the latter is UB. This commit amends befda1accab417ce5f55cb11816e6ded51af55e3. Pick-to: 6.6 Change-Id: Ia2c110b5744c3aaa53eda39fb44984cf5a01fac2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUuid: handle quint128 and Id128Bytes data in the same wayIvan Solovev2023-07-171-6/+12
| | | | | | | | | | | | | | | | | | The QUuid(quint128) ctor was handing the incoming data differently from the QUuid(Id128Bytes) ctor. Same was valid for the return values of QUuid::toUint128() vs QUuid::toBytes(). The provided test didn't reveal it, because it was treating the same 128-bit input value as BE in one place, and as LE in another place. This patch fixes the test, and updates the implementation of QUuid(quint128) ctor and toUInt128() method to verify that the updated test passes. This commit amends 8566c2db85a6f579a1a0432d0b7621633158e04c Pick-to: 6.6 Change-Id: I24edb8ba0c8f7fd15062ba0b2a94ad387c3e98b6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLibrary: make isLoaded() report whether this object has load()edThiago Macieira2023-07-101-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c2a92199b57b195176d2a0d68d140d72c1cbfb71 "QLibrary::setFileNameAndVersion: reset the tag after findOrCreate". This restores the behavior of resolve() and compatibility with Qt 4 and 5, which is documented to imply a call to load(). Do note that if you call load() or resolve() and don't call unload(), the library you've loaded can never be unloaded now. So don't leak! [ChangeLog][Important Behavior Changes] QLibrary::isLoaded() now reports whether this instance of QLibrary has succeeded in loading the library, via direct or indirect call to load(). Previously, it used to reported whether the actual library was loaded by any QLibrary instance. The change to QLibrary::resolve() itself is effectively a no-op in this patch, because isLoaded() would have returned false, but it ensures that the implementation does what it says it will do. Fixes: QTBUG-114977 Pick-to: 6.6 Change-Id: I907aa7aea8ef48469498fffd176d7a76ae73e04a Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* CMake: Make corelib tests standalone projectsAlexandru Croitor2023-07-055-0/+30
| | | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I28b6d3815c5f43d2c33ea65764f6f3f8f129eaf3 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLibraryPrivate: Actually merge load hintsIevgenii Meshcheriakov2023-06-204-4/+54
| | | | | | | | | | | | | | | | | | | Or old and new load hints in mergeLoadHints() instead of just storing new ones. Andjust QLibraryPrivate::setLoadHints() to handle objects with no file name differently and just set load hints directly. Mention that load hints are merged once the file name is set in the documentation for QLibrary::setLoadHints(). Add a regression test into tst_qfactoryloader. Update and extend tst_QPluginLoader::loadHints() to take into account load hints merging. Fixes: QTBUG-114480 Change-Id: I3b9afaec7acde1f5ff992d913f8d7217392c7e00 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUuid: add support for 128-bit integersThiago Macieira2023-05-201-0/+26
| | | | | | | | | [ChangeLog][QtCore][QUuid] Added support for converting between QUuid and quint128, on platforms that offer 128-bit integer types (all 64-bit ones supported by Qt, except MSVC). Change-Id: Id8e48e8f498c4a029619fffd1728c9553e871df5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* 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>
* QPluginLoader: don't instantiante multiple, identical instancesThiago Macieira2023-04-051-7/+19
| | | | | | | | | | | | | | | | | This can happen if the same project has two or more Q_IMPORT_PLUGIN macros in their source. And that can happen when converting from qmake- based builds to CMake, as qmake didn't generate a source file with the macro but CMake does. [ChangeLog][QtCore][QPluginLoader] staticInstances() will not call duplicated registrations of the same instantiation function, which can only happen as a result of duplicated Q_IMPORT_PLUGIN for the same plugin name. Fixes: QTBUG-102745 Pick-to: 6.2 6.5 Change-Id: Idd5e1bb52be047d7b4fffffd174fb9dd62d8583d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definitionEdward Welbourne2023-03-204-8/+8
| | | | | | | | | | 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>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-1721-124/+4
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QUuid: add the ability to specify the byte order for 128-bit IDsThiago Macieira2022-12-161-0/+6
| | | | | | | | Some more modern protocols like Bluetooth LE transmit data in little endian. QtBluetooth will benefit from this. Change-Id: Id8e48e8f498c4a029619fffd1728c94ddd444537 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QUuid: add a trivial structure to support exactly 128 bitsThiago Macieira2022-12-161-1/+23
| | | | | | | | This is inspired by QBluetoothUuid's quint128, but with a better name. It also matches systemd's sd_id128. Change-Id: Id8e48e8f498c4a029619fffd172893dc1545adda Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QLibrary: fix loading multiple versions of a libraryThiago Macieira2022-10-201-0/+66
| | | | | | | | | | | | | | | | | The libraryMap only stored the file path, so we couldn't load two versions of the same library as we'd find the other version already loaded. Change the map to index by file name and version (using a NUL as separator, since that can't appear in file names). [ChangeLog][QtCore][QLibrary] Fixed a bug that caused QLibrary to be unable to load two different versions of a library of a given name at the same time. Note that this is often inadviseable and loading the second library may cause a crash. Pick-to: 6.4 Change-Id: I12a088d1ae424825abd3fffd171ce3bb0590978d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QLibrary: fix load() after a failed load()Thiago Macieira2022-10-181-0/+74
| | | | | | | | | | | Regression introduced by commit 8d4eb292b2e8fc14437db97febdc2eebe36ed3ce in 6.0, when QTaggedPointer was introduced. We set the tag even when the loading failed and failed to reset it because d = {} retains the tag. Pick-to: 6.2 6.4 Fixes: QTBUG-103387 Change-Id: Ie4bb662dcb274440ab8bfffd170a07aa9c9ecfca Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QLibrary: add a cleanup() method to unload left-oversThiago Macieira2022-10-191-0/+33
| | | | | | | | | | | | | | | QLibrary intentionally does not unload on destruction, so failing tests may leave libraries already loaded and cause further tests to fail because of that. So add a cleanup() method to unload everything we may have loaded. Note that QLibrary::unload() sets its state to NotLoaded after one successful call, so we must recreate the object in case it had been load()ed multiple times. Pick-to: 6.2 6.4 Change-Id: I12a088d1ae424825abd3fffd171d133c678f910a Reviewed-by: Marc Mutz <marc.mutz@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>
* tst_QUuid::fromString(): tweak a test to avoid data-tag collisionEdward Welbourne2022-10-111-1/+1
| | | | | | | | | | | | | | | | Two of the uuidA test cases had an open-brace for the string and no close; one of them ended with a space (which, apparently, is valid). Since the data-tag was constructed by formatting the string in a fixed-width field, padding with spaces, these two cases coincided. Fortunately the only uuidB test-case had closing as well as opening braces, so we can just switch the test for "trailing space is not an error" to use it, instead. Change-Id: I7068d40145c6b6b3b72777b029282850b1d1ea81 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mate Barany <mate.barany@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-012-0/+3
| | | | | | | | And include qcore_mac_p.h where needed. Task-number: QTBUG-99313 Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Fix tst_qlibrary to work on macOS with debug buildsAlexandru Croitor2022-08-312-20/+40
| | | | | | | | | | | | | | | | The test expects the helper libraries to contain the .dylib suffix rather than .so. Replace glob copying of the libraries (which depends on the underlying shell) with manual copy calls. This also ensures the libraries don't contain a _debug postfix in the file name even in a debug build, which would break the tests. Amends f8c1909320313c8a9c03661d8fe77728bde6556a Amends 1dff26dd9539feb40767b7761c5339085ad74dbf Change-Id: I20361c33c4a1b9dd4b5273fcdb8cc79c9f266327 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_qlibrary.cpp: remove extraneous _data functionThiago Macieira2022-08-301-7/+1
| | | | | | | The test function itself is MIA. Change-Id: Ie4bb662dcb274440ab8bfffd170a06fde5c1cd51 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2322-22/+22
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Android: skip tst_QPluginLoader::loadSectionTableStrippedElf()Assam Boudjelthia2022-08-181-0/+4
| | | | | | | | | | | | | | ... on Android 7+ because Android linker doens't accept missing or bad section headers. * https://android.googlesource.com/platform/bionic/+/refs/heads/oreo-r2- release/android-changes-for-ndk-developers.md#missing-section-headers- enforced-for-api-level-24 Pick-to: 6.4 6.3 6.2 Task-number: QTQAINFRA-4748 Change-Id: I37fcf7995bbfe7d258b92f7425baf4722b0ad4ab Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-0322-0/+66
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-2812-15/+15
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1630-812/+62
| | | | | | | | | | | | | 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_QPluginLoaderIvan Solovev2022-03-304-9/+65
| | | | | | | | | | | | | | - Use QT_ANDROID_EXTRA_LIBS to correctly deploy libraries on Android. - Update the test code to use application libraries directory 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: Ib74da036472320736888052b63a45ca50431de48 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: activate tst_QLibraryIvan Solovev2022-03-305-76/+62
| | | | | | | | | | | | | | | | On Android we demand the libraries to always start with "lib" and end with ".so" extension. Also Android does not support versioned libraries. This patch updates CMakeLists.txt to fulfill these requirements, and also omits some unsupported test cases. This allows to enable this test for Android in CMakeLists.txt Task-number: QTBUG-87438 Pick-to: 6.3 6.2 Change-Id: Iec30acdefe00c471acc7139cd255b3389e31d22b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: activate tst_qfactoryloaderIvan Solovev2022-03-255-76/+50
| | | | | | | | | | | | | | | | | | | - Use QT_ANDROID_EXTRA_PLUGINS to specify a correct plugins directory - Update plugin names on Android to match the expected format - Add explicit dependency on the plugins, so that they always get built and included in the APK - Update the test code to respect the fact that plugins are packed differently on Android. All these steps allow to enable this test for Android in CMakeLists.txt Task-number: QTBUG-87438 Pick-to: 6.3 6.2 Change-Id: I09e389c761688cea216d8922b94ea3a2600f7a67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: activate tst_QPluginIvan Solovev2022-03-253-14/+34
| | | | | | | | | | | | | | | - 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>
* Add VERBATIM option to add_custom_command callsAlexey Edelev2022-03-172-6/+5
| | | | | | | | | | | Use VERBATIM option to prepare the correct command line for the add_custom_command. This especially sensitive when using build directories with names containing special symbols, that cannot be handled by shell correctly. Change-Id: I51d7041cb806411135fd59bf6273c04a3c695443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
* QPluginLoader: report the right load hintsGiuseppe D'Angelo2022-02-031-1/+10
| | | | | | | | | | | | | | | A default-constructed QPluginLoader erroneously reports that the load hints are empty. However, setting a filename would then automatically set the PreventUnload hint, surprising the user. Return the correct flags instead. Amends 494376f980e96339b6f1eff7c41336ca4d853065 Change-Id: I7a95964cb680afd3adf2f71ed73d2f93023238f2 Fixes: QTBUG-100416 Pick-to: 5.15 6.2 6.3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFactoryLoader: add setExtraSearchPath() (for QPA plugins' use)Thiago Macieira2022-01-201-4/+35
| | | | | | | | | | | | | | | | | This is added specifically for the QPA platform and theme plugins, to honor the QT_QPA_PLATFORM_PLUGIN_PATH environment variable and the (inadvisable) -platformpluginpath command-line argument. This removes the last QFactoryLoader used with an empty path (also the only two that could be reached), which were causing a scan of the application's binary directory whenever the platform plugin path was set. In case of applications installed to /usr/bin, the entire /usr/bin was scanned, which can be qualified as "not good". Fixes: QTBUG-97950 Pick-to: 6.3 Change-Id: Ice04365c72984d07a64dfffd16b47fe1d22f26d3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Q*Parser: Replace "data" with "contents" in stringsRobert Löhning2022-01-121-3/+3
| | | | | | | | | ...to be clearer and avoid confusion with "data section". Change-Id: I13319be0e3e12aecf1e0e86c256007dfe6cb98c6 Pick-to: 6.3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNX: check and use elf.h from alternative locationJanne Juntunen2021-11-301-9/+8
| | | | | | | | | | | In QNX, instead of #include <elf.h>, we have to use #include <sys/elf.h> since that file is placed in a subdirectory. Also removed the previous workaround. Fixes: QTBUG-97833 Change-Id: Id932a5eeb618a42c8778459cdfd8bb5bf903523c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>