aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add qbs.hostArchitecture propertyIvan Komissarov2020-03-114-0/+27
| | | | | | | | | | This property can be useful when some parts of the project (e.g. helper tools) should be compiled for the host platform/architecture disregarding what targetPlatform/architecture the rest of the project is being built for Change-Id: I8c76ef65470130df59826603157083fd20809592 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix emptyProfile autotestChristian Kandeler2020-03-101-13/+21
| | | | | | | | | | | It was broken for e.g. mingw. Prevent future failures by simply forwarding qbs.toolchainType from the profile. Also forward the toolchain install path for non-MSVC profiles if it's not in the PATH. Change-Id: I73a799387af2e746ebdd634171129f9d201478db Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Simplify the emptyProfile autotestChristian Kandeler2020-03-091-3/+1
| | | | | | | | | There is no need for a temporary settings dir: We have the special "none" value for profiles. Change-Id: I4a07053e81e94d999f3a6827c51b04d32725ffcb Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Qt: Add support for the new QML type registration mechanismChristian Kandeler2020-03-097-0/+354
| | | | | | | | | | This implements the Qt 5.15 type registration approach via the qmltyperegistrar tool. Fixes: QBS-1531 Change-Id: Id77572a521513dc1759b02a7f7299377c2bcaabb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* setup-toolchains now sets the qbs.toolchainType, not qbs.toolchainIvan Komissarov2020-03-095-19/+28
| | | | | Change-Id: I21f0626a093db358f8f5dfa6248672c44edc82e2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add "profiling" build variantIvan Komissarov2020-03-064-0/+38
| | | | | | | Also known as "release-with-debug-info" Change-Id: Ieed358810ea423ea7a9a1a52a36fa35cf165dfac Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add clang-cl to the list of known toolchainsIvan Komissarov2020-03-061-0/+4
| | | | | Change-Id: I4521ac3de8822a9b7fecb33f6aa27cb380f01ed9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Qt support: Add support for moc metatype filesChristian Kandeler2020-03-067-0/+94
| | | | | | | | From Qt 5.15 on, moc can generate metatype information in JSON format. Task-number: QBS-1531 Change-Id: Ie6969f70bac51cc80f11057841ba8d4b7947c646 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Rule execution: Fix potential infinite loopChristian Kandeler2020-03-054-0/+43
| | | | | | | | | | | | | | | | | | Dependency scanning can generate inverse dependencies. For instance, a Qt C++ file "myobject.cpp" containing the Q_OBJECT macro will typically include a file "myobject.moc", which is generated from the cpp file. When scanning the inputs of "myobject.moc", the artifact will encounter itself as a scan dependency. There is code that prevents a dependency cycle in this case. Let's now consider the case where such a rule has a second output artifact: When scanning the inputs of that artifact, we will encounter the first artifact as a scan dependency. This case was not handled, leading to an infinite loop in rule execution. We fix this by rejecting scan dependencies that have the same transformer as the artifact whose inputs are being scanned. Change-Id: I767ceaad387c2e315738070e01ef9322764afb65 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Artifact Scanning: Prefer scan results from product dependenciesChristian Kandeler2020-03-038-0/+64
| | | | | | | | | | | | | | | | If scanning finds an artifact in more than one product, we so far randomly used one of them. We now prefer artifacts from product dependencies, because the other ones might get lost during change tracking, as we don't keep an "is scan result of" type of information in our RescuableArtifactData. This should fix the linked bug in the vast majority of actual projects. It's also conceptually the right thing to do, because the artifact in the product dependency is much more likely to be the one that was intended to be found. Task-number: QBS-1532 Change-Id: Idd8662bb00570bc57f5861ce83517f0adb845b49 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the error when the last module candidate is not a moduleIvan Komissarov2020-02-276-0/+21
| | | | | | | | | | Previously, if the last module candidate was not a module item, the value of triedToLoadModule was set to 'false'. However, we could try to load the one of the previous candidates which means that triedToLoadModule should be set to 'true' Change-Id: I03278d51804568ebbd4dee93313c16517fd774e9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Introduce QBS_TEST_SOURCE_ROOT environment variableRichard Weickelt2020-02-275-7/+32
| | | | | | | | | | | | | | | This patch introduces QBS_TEST_SOURCE_ROOT environment variable that can be used to customize the source location of test data. Previously, the original testdata location was compiled into the test binaries. Thus it was impossible to run the test suites on a different host than the build host. In order to improve test coverage, we want to build the test suites once (for instance in a Docker environment) and then run them multiple times in different environments which might have a different file layout. In that case, the testdata location must be configurable. Change-Id: I7673826e6ea6f2e3aa893e657351a84c49a1033e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add XFAIL-ing autotest for newly discovered bugChristian Kandeler2020-02-269-0/+69
| | | | | | Task-number: QBS-1532 Change-Id: I54480b044610fc5018938866700e6ba53ce05f15 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Autodetect clang-cl by using ProbeIvan Komissarov2020-02-171-0/+15
| | | | | | | | This allows to build projects without calling "qbs setup-toolchains" first by simply calling "qbs build qbs.toolchainType:clang-cl" Change-Id: I86d135ddf2cb588f322709e4e7a265cb6fd7772f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add ConanfileProbe item for querying conan recipe filesRichard Weickelt2020-02-155-0/+107
| | | | | | | | | | | | Conan is a popular C/C++ package manager. Conan packages including their configuration and dependencies are usually described as conanfile.txt/.py. ConanfileProbe runs 'conan install -g json' and parses the resulting conanbuildinfo.json. The resulting JS object tree contains relevant information about the dependencies and can be used to set module properties in Product, Profile or even Module items. Change-Id: Ied6b917f061dac67fb2260eab099bcce4037750d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Autotedect MSVC compiler by using a probeIvan Komissarov2020-02-144-0/+16
| | | | | | | | This allows to build projects without calling "qbs setup-toolchains" first by simply calling "qbs build". Change-Id: Iba4af8bf77d0ee5d209564ea371328d3c6cf2aa2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix code signing for Core Foundation bundlesLeon Buckel2020-02-131-0/+1
| | | | | | | | | | | | | | | | xcode.qbs: - Change the contents of xcode._actualSigningIdentity as expected by the actualSigningIdentity and actualSigningIdentityDisplayName properties - Use Utilities.signingIdentities() to get rid of warning ’Suspicious use of Process during property evaluation...’ - Throw error if specified identity was not found BundleModule.qbs: - Add ‘_CodeSignature/CodeResources’ to outputArtifacts with the tag ‘bundle.code-signature’ and ‘bundle.content’ - Remove local var ‘bundles’ which was always undefined - Fix ‘ModUtils.moduleProperty("qbs", "pathSeparator")’ resulting in ‘TypeError: Result of expression 'obj.moduleProperty' [undefined] is not a function.’ Change-Id: I1a529efb6164906d21203ff3f3be6e570137e8ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* More meaningful SKIP messages for macOSIvan Komissarov2020-02-061-4/+9
| | | | | | | | Otherwise, it's quite hard to understand why the test is skipped in CI without looking into the code Change-Id: I5e4450c22c6b0474dac291d488e8f49d0607e290 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Install some packages on Mac jobs to run more testsIvan Komissarov2020-02-061-0/+1
| | | | | Change-Id: I90865ba6908df1550c2646a57d348dcb82e244ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge branch '1.15' into masterRichard Weickelt2020-02-052-20/+34
|\ | | | | | | Change-Id: I7e348db380b836221db79c73ea3b5f1d891f114b
| * Fix probes referencing project properties1.15Richard Weickelt2020-02-052-20/+34
| | | | | | | | | | | | | | | | | | This patch fixes a regression introduced in e8637511. Probes in Project items could no longer reference project properties by writing project.xxx on the right hand side of a property assignment expression. Change-Id: I7d04c71f4c493481a00411f12666bd6c2caa8caa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Android: Update support to qt 5.14 and multi-arch apks for Qt appsRaphaël Cotty2020-02-044-67/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before qt 5.14. The profile property "moduleProviders.Qt.qmakeFilePaths" is set with one or more paths to the different android architectures. Each qmake path belongs to a different android architecture installation. So each qmake is used to generated the Qt module corresponding to the architecture. Although qbs can generate multi-arch apks using multiplex mode, this is not possible when the project depends on qt libraries. This is because of the restriction of the qt tool androiddeployqt used by qbs. Now with qt 5.14. All android architectures are installed in the same directory. So the profile property "moduleProviders.Qt.qmakeFilePaths" is set with one qmake path. This directly impacts the qbs-setup-android tool and the generation of the Qt modules. Because qt libraries are installed in the the same directory, they have the abi in their name (libQt5Core_armeabi-v7a.so). So the rules that generate the apks are also impacted. The new androiddeployqt have a new interface (json config file format and requires to have the input libraries installed in the deployment directory) which allows the generation of multi-arch apks. So Qt.android_support modules needs to be updated as well. Fixes: QBS-1497 Change-Id: Ibd546f356c38a05f42dfcac0a4ec92bd82d6f700 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Improve TestBlackbox::pathProbeIvan Komissarov2020-02-0315-8/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add checks for the candidatePaths and the single file API. Also, this includes a behavior change - if multiple selectors are present, the filePath/fileName/path probe properties are not set up - this is because it is not clear how they should be set up in case when the first file in selectors is found, but the second is not (and thus probe.found is false). In case of multiple selectors, user should use probe.allResults but not the single file API. Change-Id: Ib56faf0de93d3ec9fc49f5dbc9d51d4b36831a2d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Tests: Fix expected path for jdkChristian Stenger2020-01-301-0/+1
| | | | | | | | | | | | | | OpenJDK might be the 64bit version. Change-Id: Ia215ac3ed4c111a3d127b97509d150b34f9a01fa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Tests: Do not expect sanitizers for MinGWChristian Stenger2020-01-301-0/+2
| | | | | | | | | | | | Change-Id: I283836a7009f63bc3c8c5aabae221ec7763ddcef Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Allow relaxed matching of multiplexed dependenciesRichard Weickelt2020-01-294-3/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a multiplexed product depends on another multiplexed product, Qbs previously forced all multiplexed properties to match exactly. Only if Depends.profiles was specified, the comparison was limited to the qbs.profile property and all other properties were ignored. While strict matching is usually the natural choice, there are corner cases where it limits the applicability of Qbs. For example when multiplexing product A over buildVariant, but product B over buildVariant and architecture. In such cases a relaxed matching would be desirable, where only the common properties of A and B are considered. As long as there is only a single resulting dependency, the dependency is unambiguous and safe. Task-number: QBS-1515 Change-Id: I4ae6b413229bf1577311b4198d0596447e650816 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply 'modernize-pass-by-value' fix-itIvan Komissarov2020-01-288-18/+19
| | | | | | | | | | | | | | | | | | Also, treat this warning as error This amends 936eee744db9b2fd1b9b66d168d80a113002aad2 Change-Id: I372c3b11baa08375d581052282f4546b2ba2e057 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | MSVC: Use compiler driver for linkingIvan Komissarov2020-01-246-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to use cpp.driverFlags and cpp.driverLinkerFlags with clang- cl. This patchset makes possible to use clang-cl with "- fsanitize=address" flag without passing the sanitizer libraries manually to the linker There's also a behavior change in which linker is used - clang-cl uses native linker by default. Old behavior can be restored by setting cpp.linkerVariant to "lld" Fixes: QBS-1522 Change-Id: I9528ce40aa5fdfab987672b15fffd830fa2d6376 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Test for the correct value for the NSPrincipalClassIvan Komissarov2020-01-201-1/+1
| | | | | | | | | | | | | | Qbs sets this value unconditionally for macOS platform, so check it Change-Id: I98c2b3f8a9ac6978411eb51a17f1104118faebe2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add checks for some types in infoPlistIvan Komissarov2020-01-201-0/+24
| | | | | | | | | | | | | | | | | | | | Checking the exact values is hard because they depend on the targetPlatfom/architecture, but we can check that types are correct if those values are present. Task-number: QBS-1447 Change-Id: I4407421919ad74719ce089d059cbe36764a565d8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | travis: Add XCode 9.4 jobIvan Komissarov2020-01-203-0/+3
| | | | | | | | | | | | | | | | | | | | | | This is still the default one on Travis and Qbs should support it Also, only build XCode10 variant on master to avoid extra job for gerrit builds Change-Id: I100e7e4560aeca3c2c3d77d81ecc9097853e0a2d Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add overrideInfoPlist testIvan Komissarov2020-01-155-26/+112
| | | | | | | | | | | | | | | | This test checks that properties can be overridden in a .qbs file Task-number: QBS-1447 Change-Id: Ib39c7c11f26357bb4074eb9ba7cb2730f25c9441 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use an empty array for the qbs.targetOS if targetPlatform is undefinedIvan Komissarov2020-01-143-0/+20
| | | | | | | | | | Change-Id: I4bc1ff7cacb606e4baa9f2bfe59b8dca1b88e434 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add Docker environment to test Qbs with Qt for AndroidRaphaël Cotty2020-01-105-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Docker images contains ndk r20 and qt 5.13.2 as well as 5.14.0. Containers can be started with the following command line: - docker-compose pull bionic-android-513 - docker-compose run --rm bionic-android-513 The current folder is mounted under /qbs. Assuming that Qbs has been built in the current directory and with release configuration, the autotests can be invoked with: docker-compose run --rm bionic-android-513 scripts/test-qt-for-android.sh \ release/install-root/usr/local/bin A job Travis CI job is added which builds Qt and runs the Android blackbox tests. Change-Id: I76b1901cb7c41f8b5b0122265c99c9b37b59f261 Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | API tests: Fix a time stamp issueChristian Kandeler2020-01-081-0/+1
| | | | | | | | | | Change-Id: Ia58cf8c14b091372921788e76e15a2ad1267e3d3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Order list properties by dependenciesRichard Weickelt2020-01-089-7/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List properties of all dependent modules were previously merged in lexicographical order and did not take any module hierarchy into account. This resulted in errors, for instance when multiple inter-dependent modules specified cpp.staticLibraries and the libraries had dependencies on each other. This patch merges list properties according to the top-sorted modules list. This is equivalent to a breadth-first search in the dependency graph. Modules on the same hierarchy level are merged in reverse lexicographical order for implementation simplicitly. For instance, the modules Qt.core, Qt.gui and Qt.network would be merged in the order Qt.network, Qt.gui, Qt.core. The resulting order is stable and does not dependent on anything else than the actual dependency relationships and the module names. I.e. the order of Depends items is irrelevant. This change leads to a much simpler implementation of ModuleMerger and has the positive side-effect that property values are evaluated in the correct scope more often. A warning is now generated when multiple modules write to the same scalar property and the warning is being tested. It was previously there as well, but did not fire in all cases, for instance when an Export item wrote to a scalar property as well as an exported module. Fixes: QBS-1505 Fixes: QBS-1517 Change-Id: I450d2a84cd29afe42c17be7e946e4f755da1c49f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix 'performance-unnecessary-value-param' warningsIvan Komissarov2020-01-073-4/+4
| | | | | | | | | | | | | | | | | | | | Use more pass-by-const-ref since there is no point in passing objects by value in these cases Also, treat this warning as error Change-Id: I5382dcd56639f535cf240205cc5c3ac667c4ece3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | qbs_benchmarker: Validate commit parametersIvan Komissarov2020-01-061-0/+4
| | | | | | | | | | | | | | | | It's possible to copy&paste old commit instead of a new one and easy to overlook that mistake. Change-Id: I408f256ba6b2f419b7cf90b7ed9ee582f91b081b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | API: Do not try to do manual book-keepingChristian Kandeler2020-01-062-163/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... when adding/removing files to/from a project. We originally implemented this so that IDE users could edit their project files via the UI without having to re-resolve the project, thus saving time. However, great care has to be taken to ensure that we really do the same thing as would happen on a proper resolve step, and we do not seem to manage, as demonstrated by the crashes I have observed recently when removing files via Qt Creator. So let's play it safe and remove the shortcut. Change-Id: I38e7dcdba0aa129f43feec084ae140e1a57d2ee9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Add freedesktop moduleAlberto Mardegan2019-12-207-0/+82
| | | | | | | | | | | | | | | | | | This module helps UNIX application developers to prepare applications following the freedesktop.org guidelines. Change-Id: I9ae4dfbdb1e672a9d152242ad2eb50651f86461f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix wrong behavior of Depends.profilesRichard Weickelt2019-12-196-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | When Depends.profiles contained a non-existing profile, Qbs just crashed. When Depends.profiles was set, but the dependency had an aggregator, the aggregator was always selected. This behavior was wrong. When Depends.profiles is set, it must take precedence and the aggregator must be ignored. Fixes: QBS-1513 Fixes: QBS-1514 Change-Id: I214afe0e2921b773ea1c224732c5c5430e7af063 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Adapt source code to Qt 6Christian Kandeler2019-12-172-2/+3
| | | | | | | | | | | | Change-Id: If84e3e4c832c2b3dc39e40be13e989996ab764d1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Apply 'modernize-make-unique' fix-itIvan Komissarov2019-11-282-5/+7
| | | | | | | | | | Change-Id: I93783cfa3267f69237b0ad888d0747e4272cda0a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply 'modernize-use-equals-default' fix-itIvan Komissarov2019-11-255-9/+5
| | | | | | | | | | Change-Id: Iabdc777d2e8492d9903109365b0f3b1a5441ca11 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Brings the listPropertyOrder test back into a working stateRichard Weickelt2019-11-252-2/+3
| | | | | | | | | | | | | | | | | | | | | | The test case did not (anymore) do what it should. There was no output on stdErr because console.info() was used and also -qq was set which would have even suppressed warnings. Hence the test case always succeeded regardless of the property order. Change-Id: I8450abcdd032bb02726dc3a57353d8649b55d7df Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix compiler warnings on macOSIvan Komissarov2019-11-201-1/+2
| | | | | | | | | | | | Change-Id: I865357bf74bdaf88eabae5681c70a6e5032e274d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Simplify multiplexing testcaseRichard Weickelt2019-11-152-45/+0
| | | | | | | | | | | | | | | | | | | | Remove distracting items not relevant for the testcase itself. This was maybe a blackboxtest at some point in history, but now it is only an API test. We might need to expand it in the future and thus it is important to keep it free from irrelevant code. Change-Id: Icc0d962c4dbd21c32b4a99987eade2f66b8b78ac Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Skip TestBlackbox::qbsSession when project updates are disabledIvan Komissarov2019-11-151-1/+7
| | | | | | | | | | Change-Id: I2ada7907c2413583d6cb03d22837dfbfba368201 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | GCC: avoid duplicating objects in linker command lineAlberto Mardegan2019-11-1214-0/+229
|/ | | | | | | | | | | Long command lines are especially a problem when building statically in MXE. This commit tries to replicate the logic employed by qmake, where before adding a new object to the command line, all of its previous appearences get removed. Fixes: QBS-1273 Change-Id: I51c843c4a7cfc170ed4fab30deae6c4229690dd0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix user dependency scannersChristian Kandeler2019-11-051-0/+10
| | | | | | | | | Since commit 9e55ddfa97, we mistakenly passed the output artifact to the scan script, rather than the input artifact. Fixes: QBS-1511 Change-Id: Ieb2a2b3bdf0366ef203e96d578a30a0ef8b1838a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>