aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix autotests for Xcode < 10Christian Kandeler2018-10-081-1/+2
| | | | | Change-Id: Ia162d7fb17e69e4d0c30678d0e2e3bf31418a711 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Fix autotests for Xcode 10Christian Kandeler2018-10-0510-31/+40
| | | | | Change-Id: I0d218f415eedbfc75c2cf10877646f6831f38f89 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Fix TestBlackbox::cxxLanguageVersionChristian Kandeler2018-10-041-1/+1
| | | | | | | One of the if-clauses was missing an else keyword. Change-Id: Ibbc7946adedf82902748521b9c550759a4405d23 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Executor: Fix invalid assertionChristian Kandeler2018-09-033-0/+39
| | | | | | | | An artifact whose alwaysUpdated property is false does not need to exist and is therefore not required to have a valid timestamp. Change-Id: I642349c49a53e6e45d6b09d1acc87f4c9a0edae9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Fix potential false caching of module prototypesChristian Kandeler2018-08-107-0/+56
| | | | | | | | | | | | | | | | Our code assumed that products with the same profile and the same multiplex configuration would also evaluate a module's condition to the same value, which is not true: Properties such as qbs.architecture, which are commonly checked in module conditions, can be set in a product item independently of multiplexing. We now evaluate the module condition for every product. According to our benchmarker, the slowdown is a very modest 2% and does not appear to increase for larger projects. This patch amends 08ce978733, which tried to address the same problem, but succeeded only for a subset of the possible cases. Change-Id: I992e0f0d5cf207949cf5d863f242b9476ecdfc05 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* ModuleLoader: Fix edge case in Depends.productTypesChristian Kandeler2018-08-083-0/+62
| | | | | | | It makes no sense to consider multiplexed variants of the same product. Change-Id: I7ebee091264451dc587156a0c543932059ed9948 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Autotests: Prevent another false positive on slow CI machinesChristian Kandeler2018-08-021-0/+1
| | | | | Change-Id: I0243ca9cad9fcd5506a27b4b752f915633c9b493 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* GCC: Allow the -march option to be set in project filesChristian Kandeler2018-08-021-0/+5
| | | | | | | | | It is unrealistic to cover all its possible uses via dedicated properties. Task-number: QBS-1018 Change-Id: Iacfb9617ef130255c35766f057c60be9f816bca2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix false positives in artifacts map change trackingChristian Kandeler2018-07-302-6/+45
| | | | | | | | | | | | | | | | | | | | | We used to invalidate a script if it accessed the artifacts map and that map's keys are now different from what they were. However, that logic was too coarse: All rules that run after the command will add new artifacts, so such changes will be the norm, at least when the project is built for the first time. As a result, some artifacts might get rebuilt unnecessarily on the next qbs invocation. The reason why we did it that way was that we needed to consider the case where a script iterated over the elements of an artifacts map, e.g. using a for..in loop. In such a case, we cannot know which part of the map the code is interested in and the script needs to be re-run if the keys change. This is now solved with the help of a QScriptClass, which informs us if a script enumerates the keys. In all other cases, the script only accesses well-known tags, so we only have to compare the respective artifact lists and do not care about other keys getting added or removed. Change-Id: I182a50c34ece28f7ff3f7eba7a8f246e9b79b30e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Autotests: Prevent another false positive on slow CI machinesChristian Kandeler2018-07-111-0/+1
| | | | | Change-Id: I3577f425e40e1c19e5876e5d71f27455779a330e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Update the timestamps of file dependencies of rescued artifactsChristian Kandeler2018-07-103-1/+8
| | | | | | | | | | | Resetting the timestamps of file dependencies happens per artifact before the rescue procedure, so any dependencies added there must get their timestamp reset explicitly. Task-number: QBS-1359 Change-Id: Iec22b105a4132ada65b52391d4212c3b9ba52a2a Reviewed-by: Ola Røer Thorsen <ola@silentwings.no> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* benchmarker: Fix crash when called with no parametersChristian Kandeler2018-07-101-1/+8
| | | | | | | The crash was accidentally introduced in da6c0e5058. Change-Id: If3a1ed1633fc8bb6aaf736859a89e1b7c17777c2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Autotests: Prevent another false positive on slow CI machinesChristian Kandeler2018-07-061-0/+1
| | | | | Change-Id: I0ecc59ff2277be198415332af405394043fa77d4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Autotests: Prevent another false positive on slow CI machinesChristian Kandeler2018-07-061-0/+1
| | | | | Change-Id: I365acd2eb6fd27d3b31bcf7d84c00039166781ec Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix TestBlackbox::pluginDependency on MacChristian Kandeler2018-07-051-2/+4
| | | | | | | | One of the checks fails in 1.12, because we still list "qbs" as an input file tag in the bundle module. Change-Id: I8f033e4dc653989b153182c11e6607afe5658e6e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* ModuleLoader: Fix misleading error messageChristian Kandeler2018-07-043-0/+17
| | | | | | | | | If a product could not get properly loaded and a per-product property override was given on the command line, we used to erroneously complain about the property override instead of reporting the real error. Change-Id: I1cbbc8ff9b6dcd453563c4745778576342862ca3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Cover dependency parameter change tracking in autotestChristian Kandeler2018-07-042-2/+20
| | | | | Change-Id: I180feccc60857a5431e1c55354e478824f62b6fe Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Autotests: Prevent another false positive on slow CI machinesChristian Kandeler2018-06-291-0/+1
| | | | | Change-Id: Id35b1843da772f703f1b2cb60487f9513c0a8efc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Autotests: Allow to parameterize the "file unlock grace period"Christian Kandeler2018-06-292-4/+13
| | | | | | | | ... via the environment. This should help reduce false positives in our CI. Change-Id: I28492b4e476289f2d9418a272b167d9a679ebc5f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Do not crash on invalid property assignment in Export itemChristian Kandeler2018-06-262-0/+21
| | | | | | | | | | | The crash would happen when creating the export information for a product whose Export item contained an assignment of the form "x.y: original", where x is not a module and the assignment was inside a Properties item. Task-number: QBS-1362 Change-Id: I900857fcd97852360ec2b75de1b7a791fd948dc4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Provide an error location for invalid property assignmentsChristian Kandeler2018-06-252-0/+17
| | | | | | | | | | ... of the form "x.y.z: value", where there is no module x.y. The errors printed in this case did not have a location, because none of the value items are proper module instances and we did not keep track of the chain of parent items. Change-Id: I2da4da7beb5bd6f6d185a63c90d42340c9e30492 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Properly diagnose invalid module property assignmentsChristian Kandeler2018-06-254-0/+75
| | | | | | | | | ... if the non-existing module name has more than one component. We inadvertantly skipped the check in that case. Task-number: QBS-1362 Change-Id: I1fcababee1ea70c3133bd1b1c8f8f32f8450a0e8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the exportsQbs autotest for mingwChristian Kandeler2018-06-251-1/+1
| | | | | | | | Fun fact: If the file path you pass to the linker via -o does not contain a dot, then mingw will append ".exe". Change-Id: I4a4133c99fc63fd91e47c905ca902d3eb26b1146 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix rule input tags in the Exporter modulesChristian Kandeler2018-06-221-0/+26
| | | | | | | | | | We need to make sure all the artifacts are present in the build graph before writing the respective interface file, but we don't need to rewrite it if these artifacts are rebuilt. So use auxiliaryInputs instead of inputs. Change-Id: I82dee65f6630a0bbd24245df9100e4dabf0320f2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Benchmarker: Keep the temp data in case of a failureChristian Kandeler2018-06-221-5/+8
| | | | | | | So the problem can be more easily investigated. Change-Id: Ia968a4e42164cce5b3f67d9e8a29ccd5b24e3eaf Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Don't link to multiplexed libraries when depending on the aggregateAlexandru Croitor2018-06-205-0/+70
| | | | | | | | | | ... library, this can lead to warnings or linker errors. Most easily seen on macOS when multiplexing across multiple architectures, and an app ends up linking against multiple multiplexed variants of a dependent product library. Change-Id: I4ea4b419099a1010f7b8c32ee11079da93f1d236 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix lex_yacc autotests for winbisonChristian Kandeler2018-06-189-5/+47
| | | | | Change-Id: I3209a71c21ea1f91d232ab2bb607fa81c9751ad7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* MSVC: Relax version check for /WHOLEARCHIVEChristian Kandeler2018-06-181-1/+1
| | | | | | | | The flag is supported in earlier compiler versions than our code assumed. Change-Id: I5bc32c29c61885ca38e60bb8a000250a11d32b0c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Catch mis-use of "original" as default property valueChristian Kandeler2018-06-184-0/+28
| | | | | | | | This used to cause an infinite recursion, eventually crashing after running out of stack space. Change-Id: I073f7163d73a70b17bab078c8a99199bc9d21eaa Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Check for duplicate entries in multiplex propertiesChristian Kandeler2018-06-154-2/+23
| | | | | | | | | This used to lead to an error message about duplicate product names, which left the user in the dark about the actual problem. Change-Id: I460dcdf89112124cfd303529d42acd6c13fe9155 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Prevent adding empty file paths as dependenciesChristian Kandeler2018-06-084-3/+20
| | | | | | | | | The input artifact scanner was missing a check, so empty paths could end up in the list of file dependencies. As a result, the respective artifact would get rebuilt every time. Change-Id: I34e48776856224dc885f03d34d40cae88d7d5e4b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change tracking: Do not rescue outdated child artifactsChristian Kandeler2018-06-083-0/+72
| | | | | | | | | | | | | If a former child artifact is not in the list anymore after the rules applicator has run and it was not originally added as a result of scanning, then it is no longer a child artifact. We used to add these artifacts back to the list of children, so that an existing parent/child connection persisted even after changing the rule input tags in a way that the child would not match anymore. Change-Id: I700f515bbe5732bdb9251d48e3fc5ad53fb181cc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* GCC: Fix input tags for static librariesChristian Kandeler2018-06-082-0/+9
| | | | | | | | | | We forgot to adapt the static library rule back when we implemented smart relinking. Change-Id: Iea952c868ca7b5c0bda89690865d554be4893bb5 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix property values that are pure assignments of importsJoerg Bornemann2018-06-064-0/+34
| | | | | | | | Those were broken, because QScriptValue::toVariant() doesn't take QScriptValue::prototype() into account, which we set for imports. Change-Id: I571f7a4b63df08b1768f61bcc1d622f3730c2a73 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Exporter.pkgconfig: Add support for custom variablesChristian Kandeler2018-06-062-0/+4
| | | | | Change-Id: I42a01e549c15c91428d0f8bd9be03ea59c773032 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the qmlcachegen functionalityChristian Kandeler2018-06-052-1/+15
| | | | | | | | | | | | | The qmlcache module was broken in an impressive number of ways: - We forgot to adapt the Probe to a5cc49f2c6. - The return value of the validate property is never evaluated; you have to throw an error for it to have an effect. - From 5.11 on, qmlcachegen does not support the --target-architecture option anymore. Task-number: QBS-1353 Change-Id: I770ddc18ad2519c1d5db83bee9634717b1768d67 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add module Exporter.pkgconfigChristian Kandeler2018-06-0414-0/+216
| | | | | | | | | | | | This module generates .pc files for products, optionally attempting to derive some of the entries from the contents of the Export item. [ChangeLog] Added new module "Exporter.pkgconfig" for creating pkg- config metadata files. Task-number: QBS-1232 Change-Id: Ic41e645e4462e8f85ad6c2025fb967e88d3438f9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make sure probe results are also cached for shadow productsChristian Kandeler2018-06-043-0/+27
| | | | | | | | | | | | Because we don't turn shadow products into actual products in the ProjectResolver, the results of probes run in their context did not end up in the build graph and the configure scripts were therefore needlessly re-executed on the next project resolving. Fix this by storing these probe results along with the project-level ones. Change-Id: I647bbedbbe3fa6f36b536fd1b80fd321894362f8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add support for system-level settingsChristian Kandeler2018-06-015-2/+94
| | | | | | | | | | | | | In addition to the traditional per-user settings, there is now also a system-wide settings file affecting all users. The file's platform- specific default location can be overridden at build time. The qbs-config tool can write these settings via the new --system option. [ChangeLog] Introduced the concept of system-level qbs settings Change-Id: Ie6f675a74e96ce1fa7b2dd0712f6106071e848a6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* C++ scanner: Properly handle UTF-8 byte order markChristian Kandeler2018-05-305-0/+25
| | | | | | | | | | | | | | Includes in the first line of a source file starting with a byte order mark would not get detected, resulting in failure to recompile after a header file change. Skip over the BOM before passing the data to the lexer. Task-number: QBS-1348 Done-with: Ola Røer Thorsen <ola@silentwings.no> Change-Id: I894a5b1667e49be5f8ce9b5cc66e4e796fd073f1 Reviewed-by: Ola Røer Thorsen <ola@silentwings.no> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the type of the cpp.cLanguageVersion propertyChristian Kandeler2018-05-287-0/+57
| | | | | | | This was forgotten in 2bda52aa3d. Also added autotest. Change-Id: Iba8c7c7aa6629f321017315b03964ce20809ac23 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix TestBlackbox:vcsGit testAlexandru Croitor2018-05-181-0/+1
| | | | | | | | Need to wait for a new timestamp, to make sure rules see all the changes. Change-Id: I972737e44d89d10cfa55eae41c5ac44c3c69e021 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Do not export anything from disabled productsChristian Kandeler2018-05-181-3/+0
| | | | | | | | | | | | | | | | | Before this patch, if a product had a non-required dependency on another product and that product's condition was false, then the dependencies from the disabled product's Export item still got into the importing product, which is not what users expect. The fix is achieved by splitting up the addTransitiveDependencies() function and moving the part that is not required for determining the dependencies between products into handleProduct(). In that function we already have definite knowledge about which dependencies are enabled, so we can simply filter out dependencies of modules representing products that are disabled. Task-number: QBS-1250 Change-Id: I787a4554b2ced3924e0c6ab7e78bd73221fbecdc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Mark parent artifacts explicitly as out of dateChristian Kandeler2018-05-184-0/+36
| | | | | | | | | | ... after a transformer finishes. This makes our "out of date" check independent of the local clock resolution for generated artifacts that do not have source artifacts as children. Change-Id: If3d47f1fd859c30846806fabaddf3b47a840a6d3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* ModuleLoader: Remove unneed loadBaseModule() callChristian Kandeler2018-05-175-0/+46
| | | | | | | | | | | | | | | That call was probably conceptually unneeded since d08ce8f643 (because from then on the module instance, which already has a qbs instance, was used to evaluate the condition), and harmful since be8432fac9 (because the loadBaseModule() call then happened on the shared module prototype). This patch also needs to touch the module merger: Because the prototype is now not tainted with qbs properties from the product item anymore, we have to make sure that variant values are not ignored during module merging; otherwise, qbs properties set by the multiplexing procedure could get lost in the merge process. Change-Id: Iae5d47dbe018d330f4c96e919bb0f83c086ae1df Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make Depends.productTypes in Export items workChristian Kandeler2018-05-162-3/+59
| | | | | Change-Id: I441c0454ee7a4b928c132052c49db1cddc34d3c9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow module instances with the same priority in different search pathsChristian Kandeler2018-05-1510-9/+52
| | | | | | | | | | The search path order provides additional prioritization. Conflicts can now only occur between candidates in the same directory. This is needed e.g. to allow distributions to provide global search paths. Change-Id: I698a96e8943041fb0c4536901f75394bacd7fb40 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix TestBlackbox::makefileGenerator on macOS againChristian Kandeler2018-05-141-0/+2
| | | | | | | One of our test machines still had problems. Change-Id: I49ec0ffd9831fbe768155a132f2d8db674e0db87 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix TestBlackbox::maximumCxxLanguageVersion() againChristian Kandeler2018-05-141-2/+4
| | | | | | | | | It turns out that the gcc versions on some of our test machines are so old that they don't even know the deprecated "c++1z" value yet. So don't require the compiler call to actually succeed. Change-Id: I751223f073edbd207e078c2bb018cdea4cd95e64 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix TestBlackbox::maximumCxxLanguageVersion()Christian Kandeler2018-05-141-3/+4
| | | | | | | | Some of our test machines have older compilers, so also check for the deprecated command-line options. Change-Id: I589c29faf3cafd6bd22e975e3d80ea4f24e39507 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>