aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Fix PathLists in ProbesIvan Komissarov2024-03-054-0/+29
| | | | | | Fixes: QBS-1785 Change-Id: I59e86d9caf80ac1e8870d53d0a91cb88ad0d35b5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add CMake Exporter moduleRaphael Cotty2024-02-298-2/+230
| | | | | | | | The module allows to generate a cmake package for Qbs libraries. Change-Id: I4405899ad73e87aeb63bd8471596e89770591b38 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix wildcard change trackingChristian Kandeler2024-02-137-0/+47
| | | | | | | | | | | | | We recorded both too many and not enough time stamps for wildcards: - We should not try to track changes regarding recursive wildcards ("**/"), as that can easily pull in large parts of the source tree and/or the project root directory, likely resulting in unwanted re-resolvings. - We should track the parent dir of a wildcard pattern, even if the last evaluation yielded no matches. Change-Id: I8e5521a2fcb7fd1f54103e0df566f33dd6f2a972 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Do not run module validators for erroneous products in IDE modeChristian Kandeler2024-02-132-13/+18
| | | | | | | | Otherwise, we will potentially emit unwanted warning messages. Amends 5af4f376f88e7859667de6be0eff8f8af304528d. Change-Id: Icf55cfde089ae9f371c125bdad3eb79768070578 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Language server: Add completion supportChristian Kandeler2024-02-085-14/+32
| | | | | | | | | | This feature uncovered some sloppiness in our handling of QVariant types, which has now been fixed. Task-number: QBS-395 Change-Id: I687cef7470d97fe7887e4a7a1dbe672b2b9c79ec Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io>
* Tutorial. Part 1Ivan Komissarov2024-01-305-0/+151
| | | | | | | | This change adds a step-by step tutorial that helps to explain Qbs concepts and best practices for new users. Change-Id: I5c669f8fa0f89b8300f241bb8e4ed7cd4b3bb4c6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove qbspkgconfig.mergeDependenciesChristian Kandeler2024-01-293-56/+0
| | | | | | | As promised. Change-Id: I2e13d220057225f1afcad0cab1e5e049313cae2b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Implement allowedValues in ProvidersIvan Komissarov2024-01-224-0/+46
| | | | | | Fixes: QBS-1748 Change-Id: Ib8a0fb8eaa6076934396eeb209133411d0384f15 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Do not traverse private depsIvan Komissarov2024-01-195-0/+82
| | | | | | | | | | | | Previously, recursion was not terminated for private dynamic libraries leading to slow performance. Also, remove now redundant deduplication that happened later. Fixes: QBS-1714 Change-Id: Ia28f9993de8a55d6615c4ba0f7a4ef90721e31ff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 2.2 into masterChristian Kandeler2024-01-1923-16/+122
|\ | | | | | | Change-Id: Id7e1b77e70eb04ff84699d2f32ec80f55c8b7ec0
| * DependenciesResolver: Fix module name prefix collision checkChristian Kandeler2024-01-1915-4/+51
| | | | | | | | | | | | | | | | | | The algorithm did not properly handle names with more than two components. Fixes: QBS-1772 Change-Id: Ia680c69907c449e46977f2c5615707805a3b785f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
| * DependenciesResolver: Don't attach properties on non-present modulesChristian Kandeler2024-01-188-12/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to do that anyway and then suppress the resulting exception, but that can lead to an unexpected state later. The sequence that triggered the linked bug was as follows: - load module via non-required dependency in other module - exchange placeholder item in the product item and try to attach non-existing property on the module instance - suppress the resulting exception (because the dependency was not required) and continue - load module again (required this time) on product level - exchange placeholder item again -> assertion, because we have a module instance instead of the expected placeholder Another way to fix this would have been to revert exchanging the placeholder item after encountering an error, but that would be more complex, and there is no reason to attach properties to non-existing modules anyway. Fixes: QBS-1776 Change-Id: I581a076d1d872616b186e4015873baeea211b647 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
| * Fix qbspkgconfig Qt provider in case there is no QtIvan Komissarov2024-01-152-0/+15
| | | | | | | | | | | | | | | | | | | | | | Our tests did not cover the case when there is obviously no Qt that come from this provider. Add this case and check that we only get the error about missing module but no error come from the provider. Fixes: QBS-1777 Change-Id: Id3e80fd54e1519c91be37346276fd781d9f81b0a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge 2.2 into masterChristian Kandeler2024-01-129-6/+113
|\| | | | | | | Change-Id: I98cbee39cba1acd8a16eca1c9a11476e09011c15
| * protobuf: Usable without qbspkgconfigproviderBjörn Schäpers2024-01-112-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It only fails with "Can't find cpp protobuf runtime. Make sure .pc files are present" which is not helpful, since they are present. Additionally remove the grpcpp to grpc++ mapping in both pkg-config probes. This kind of amends 1772df50a3bacd91ba8125ececf774aa0e6311f9, I readded the tests. Task-number: QBS-1663 Change-Id: I73b7b76a66cc2b8eea5dddd57e5221715b6e6014 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * qbspkgconfig: Add support for the definePrefix optionIvan Komissarov2024-01-103-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On windows/msys, it is crucial to use autodetection for package paths - otherwise, Qbs is not able to detect e.g. protobuf package. The pkg-config has the --define-prefix switch that overrides the ${prefix} variables on the package with one based on the .pc file locaiton. Implement similar option and set it to true on Windows. Also fix setting sysroot to avoid duplication of sysroot in paths when prefix is autodetected. Change-Id: I2754e48a96cb2e5f01ecace616188782cb5b0d7a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * msvc: fix asm flagsIvan Komissarov2024-01-095-0/+21
| | | | | | | | | | | | | | | | Filename should be the last argument. Fixes: QBS-1774 Change-Id: I6a45df6deacdba44bbb28d54ec8a90c2ade4525d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge branch '2.2' into masterIvan Komissarov2024-01-091-0/+1
|\| | | | | | | Change-Id: I03789600e30aaa8d01d56777f08319d78813a260
| * Fix linkerMode test with recent clangIvan Komissarov2023-12-111-0/+1
| | | | | | | | | | | | | | | | For some reason, Apple clang complains about missing _main; adding single ret instruction fixes this. Change-Id: I286f774e462e747dcff9e0c9e44b1e6a68fa432f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Loader: Make module properties accessible for groups in modulesChristian Kandeler2023-12-055-0/+16
| | | | | | | | | | | | | | | | | | | | | | It's not only cumbersome having to write out the name of the surrounding module, but it actually prevents some legitimate use cases, e.g. when using a Module base item where the name of the derived module is not statically known. Task-number: QBS-1770 Change-Id: Iad4f6a16a27c51b303f26bc98fd9b2a4174d5f42 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Language server: Implement document handlingChristian Kandeler2023-12-011-1/+23
| | | | | | | | | | | | Task-number: QBS-395 Change-Id: I05945c669103f72304753736dac316728e87402f Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge 2.2 into masterChristian Kandeler2023-11-243-4/+59
|\| | | | | | | Change-Id: I1fd1798934066b081d8f29bf33c5d18ddd8a8838
| * apple: update dmgbuildIvan Komissarov2023-11-203-4/+59
| | | | | | | | | | | | | | | | | | | | | | This fixes some licensing issues, for instance, inability to add a combobox to select a license language. Also, restore tests deleted in 8da87e0f8d5aa27bb012b78bd18bd3379e2d618e. Change-Id: If62c76a8b75ec21230d91cb137382d50ec536ea6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge 2.2 into masterChristian Kandeler2023-11-171-0/+1
|\| | | | | | | Change-Id: Iba58b0831b9962c5e6adb468f9074d1d2b8e401d
| * Add 'mold' as possible value for cpp.linkerVariantThorbjørn Lindeijer2023-11-091-0/+1
| | | | | | | | | | Change-Id: Ia9a874f09d87020c6f6999e6267596a03b64e721 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Add an LSP serverChristian Kandeler2023-11-077-6/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides IDE-agnostic tooling via the Language Server Protocol (https://microsoft.github.io/language-server-protocol). The protocol implementation is taken from Qt Creator, plus a minimal set of dependencies. For now, our server provides only the "Goto definition" capability, which allows IDE users to click on a Depends item and get to the corresponding module or product. Task-number: QBS-395 Change-Id: Ia444aa7a6d1c114e4fd456098c74134ccdaadcec Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Consolidate expansion and modification test in SourceWildcardRichard Weickelt2023-11-011-4/+4
|/ | | | | | | | | | | | | | In order to make use of SourceWildcard in other contexts, any special relationship to ResolvedGroup is now removed. All information needed to re-expand the wildcards is stored inside the object. The re-expansion test has been moved into the class and the API has been simplified. SourceArtifact objects, no matter if wildcard-based or not are now stored inside ResolvedGroup and are marked by a boolean flag. Task-number: QBS-1749 Change-Id: I53bf2776685b5abf4713341387d1efa23ad316b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Loader: Emit a proper error when binding to module propertiesChristian Kandeler2023-10-182-0/+5
| | | | | | | | | | ... in Project items. This can only happen for the pseudo-qbs module that we load for Project items. Fixes: QBS-1752 Change-Id: I34fae59e14bcd2d3c06aedcf43d5c93583a3a5de Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Improve the dependency parameters implementationChristian Kandeler2023-10-127-1/+206
| | | | | | | | | | | | - It was strange that Export items could declare Parameters items, but Module items could not, so allow this for symmetry. - Implement priorities for parameter bindings in Depends items, so that higher-level modules can overwrite parameters set in lower-level modules. Fixes: QBS-1300 Change-Id: I05edd816c6a30f59aa934ac37378f9b12ad48a7c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* protobuf: remove probe-based library lookupIvan Komissarov2023-10-111-3/+0
| | | | | | | | | | It is not reliable these days and it is hard to maintain it. Only leave provider-based lookup or built-in runtime (via private _linkLibraries property). Task-number: QBS-1663 Change-Id: I1cc3e3a7b18f721fe252d9b5489ed7495a9a6366 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Loader: Fix dependency parameter extractionChristian Kandeler2023-10-041-2/+2
| | | | | | | | | The implementation was strangely convoluted and unnecessarily limiting regarding what users can do with Depends items. Fixes: QBS-1762 Change-Id: Id633a3b790fde5fb478ef1145e97535682f39703 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Make scan scripts interruptibleChristian Kandeler2023-10-027-0/+58
| | | | | | Fixes: QBS-785 Change-Id: I5aeb24419e2ff2831105ae2a07d2d325dc0583f1 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Use full product names in command line frontendChristian Kandeler2023-09-254-0/+42
| | | | | | Fixes: QBS-1207 Change-Id: I92cbca8d2842e843670f27a358b19dfe6006afbc Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Detect cyclic dependencies involving Depends.productTypesChristian Kandeler2023-09-191-2/+0
| | | | | | | | | | These cannot be detected while the product with the bulk dependency is being handled, so record the respective tags and throw an error if a product with a matching type finishes after the product with the bulk dependency. Change-Id: I1d6d2370b1849ea9aa4602df960a4203abf5ffe0 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Do not share logger between threadsChristian Kandeler2023-09-182-11/+22
| | | | | | | The logger is not thread-safe when stored warnings are enabled. Change-Id: Icb7a3add9f6162ab823c0b27059aea88822ff60a Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Autotests: Fix a project pathChristian Kandeler2023-09-131-1/+1
| | | | | | | This was broken in 268ad79759f75a25b7b192fc27283a6f1f446bb0. Change-Id: Ic97e63615bda5b6474ed31985e8e033dc8a9e371 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Bump minimum Qt versionChristian Kandeler2023-09-124-7/+7
| | | | | | | | There's no need to drop Qt 5 just yet, but we should require the latest version. Change-Id: I2653ef5c3c244453db88a48d59e2c86eb38518b5 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Properly handle the case of a local profile as top-level profileChristian Kandeler2023-09-123-0/+26
| | | | | | | | | | The use case seems somewhat dubious, as the intention is that profiles defined inside a project should also be attached inside that project (via qbs.profile), but why not support it if we can. Fixes: QBS-1756 Change-Id: I569c4c7b39c34fe6f4f5d4172139046310524773 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Tests: Remove some dependencies on profilesChristian Kandeler2023-09-1114-117/+180
| | | | | | | | | Various conditional tests were erroneously skipped when run without an explicit profile. Fix this by checking the actual toolchain used instead of profile contents. Change-Id: I9cc589f038d76112998a126cce4bf314a57c742e Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Merge 2.1 into masterChristian Kandeler2023-09-084-60/+6
|\ | | | | | | Change-Id: I6176c269e1cb23e88179d6e53f1f2bf57a668176
| * apple: fix some DMG module issuesIvan Komissarov2023-09-073-59/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix keys used in settings to match those that are actually used in python. Removed Korean and Russian license agreements - they are not listed in the allowed languages. Also, even when added to the list, Russian eula.txt makes hdutil to return with an error for some reason. Those need further investigation. Fixes: QBS-1753 Change-Id: I510d4f1896625d6a0b63c4005288d29069776c9a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * ModuleProviderLoader: Make sure pseudo module instances have a scopeChristian Kandeler2023-09-011-1/+2
| | | | | | | | | | | | | | | | | | Otherwise the Evaluator will erroneously add the instantiating item as a scope. Fixes: QBS-1747 Change-Id: If13a9b8174000d63f020b51677b855b9027d66f1 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Let users specify a job count also when resolvingChristian Kandeler2023-09-054-1/+25
| | | | | | | | | | | | | | | | | | Preparation for loader parallelization. For simplicity, we do not introduce a new command-line option, but re- use the -j flag that was already present for building. Change-Id: I71ce31ec3ccc592d222bcfe14a8aaf311126020c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Loader: Resolve products in parallelChristian Kandeler2023-09-051-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resolveProduct() function is now executed for several products simultaneously, with the (relatively few) accesses to common resources guarded by mutexes. Using Qt Creator as a mid-to-large-sized test project, we see the following changes in the time it takes to resolve the project on some example machines: - Linux (36 cores): 10.5s -> 4.8s - Linux (8 cores): 17s -> 6.5s - macOS (6 cores): 41s -> 16s - Windows (8 cores): 20s -> 9s Unsurprisingly, the speed-up does not scale with the number of processors, as there are typically lots of inter-product dependencies and some expensive resources such as Probes are shared globally. However, we do see a factor of two to three across all the hardware and OS configuarations, which is a good practical result for users. Note that running with -j1, i.e. forcing the use of only a single core, takes the same amount of time everywhere as it did without the patch, so there is no scheduling overhead in the single-core case. The results of our benchmarker tool look interesting. Here they are for qbs and Qt Creator, respectively: ========== Performance data for Resolving ========== (qbs) Old instruction count: 9121688266 New instruction count: 15736125513 Relative change: +72 % Old peak memory usage: 84155384 Bytes New peak memory usage: 187776736 Bytes Relative change: +123 % ========== Performance data for Resolving ========== (QtC) Old instruction count: 59901017190 New instruction count: 65227937765 Relative change: +8 % Old peak memory usage: 621560008 Bytes New peak memory usage: 761732040 Bytes Relative change: +22 % The increased peak memory usage is to be expected, as there are now several JS engines running in parallel. The instruction count increase is likely due to a higher amount of deferrals. Importantly, it appears to go down massively with increased project size, so it does not seem that the parallelism hides a serious per-thread slowdown. Change-Id: Ib4d9ca9aa0687c1056ff82f9805b565cc5a35894 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Allow PropertyOptions within ModulesProvider itemsIvan Komissarov2023-08-314-0/+35
| | | | | | | | | | | | Task-number: QBS-1748 Change-Id: Icfc55fa6e57cbfc32ccafbdbffb156e9405cb88e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | providers: report exceptions in Provider itemsIvan Komissarov2023-08-294-0/+31
| | | | | | | | | | | | | | | | | | If provider is seriously broken, we should give user some hints in case of optional dependencies; otherwise errors are silently ignored. Change-Id: Ie88c2c706bff600086d7760056df155b7a7e8705 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | probes: cache map variantsIvan Komissarov2023-08-293-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a StoredVariantValue that is saved in Probe items. Only QVariantMaps/Lists are stored since they can contain potentially huge objects (e.g. info plists in XCode). Cached values are now "frozen" so that users won't acceidentally modify them. Bundle module is updated accordingly to avoid mutating stored objects. This saves about 7s when resolving QtC on Mac. Change-Id: I0dd134f95105b1e4cf16e4320819db81a1c1e9a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | probes: convert jsvalue to actual typeIvan Komissarov2023-08-252-21/+45
| | | | | | | | | | Change-Id: I00903408969ae49ea6499b71f0a4066394837453 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge 2.1 into masterChristian Kandeler2023-08-253-9/+37
|\| | | | | | | Change-Id: Id331ef3cc9e7b48470d391c1c3e917bb323e41f7
| * apple: fix tests with xcode-less profileIvan Komissarov2023-08-213-9/+37
| | | | | | | | | | Change-Id: Ib606da3047c078afc0bbc44fa62cb1c111e15755 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>