aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api
Commit message (Collapse)AuthorAgeFilesLines
* Autotests: Make "copy and touch" operation atomic.Christian Kandeler2014-08-011-4/+2
| | | | | | | | | On Windows, QFile::copy does not update the timestamp on the target file. This fixes the "projectInvalidation" API test on that OS. Change-Id: I01c232de0f4e5e9bc5d2d28c24d5fb5516a58ca3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Invalidate project after certain unsuccessful re-resolving attempts.Christian Kandeler2014-07-306-1/+58
| | | | | | | Namely, if the build data has been mangled by the re-resolving attempt. Change-Id: Ibe020a6bda38a335f95e2d2cef4f37fac3199a7d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* API: Be smarter about adding files already matched by wildcards.Christian Kandeler2014-07-233-7/+45
| | | | | | | | | | | The project file does not need an update in this case. Actually, that would even lead to an error on the next project resolving, as the file would then be listed twice (once explicitly and once matched by a pattern). Task-number: QBS-653 Change-Id: If56969c36d1bba3f9194621690c2e1f25229ee9e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Allow qbs.endianness to be undefined.Jake Petroules2014-07-221-2/+0
| | | | | | | If the property IS defined, it still must be in [big, little, mixed]. Change-Id: I77d64580d1dcce8ad027500ee8e394bf05d3d961 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* API: Make the ability to update project files optional.Christian Kandeler2014-07-184-1/+9
| | | | | | | | | | | | This is the functionality that allows callers to add files to groups etc. Unfortunately, the QML/JS rewriter we use for this purpose pulls in the Qt GUI module, which results in unnecessary library dependencies if one only wants to use the command-line frontend. Therefore, allow this feature to be compiled out. Task-number: QBS-565 Change-Id: Ic134ff9cf37bd552ad493b388c05bcece983fd65 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add missing metatype registration.Christian Kandeler2014-07-163-0/+27
| | | | | | | | The code path where this is relevant has apparently never been taken, so add an autotest as well (and fix the wording of the error message). Change-Id: I314f1cb888264d30920a58f4e9cbbbf01fbcc4e6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix "build graph locking" autotest for Qt < 5.1.Christian Kandeler2014-07-161-0/+3
| | | | | | | | The locking is not implemented there, so we actually expect a failure in that case. Change-Id: Ie70aa2318915223b968f78015a796dcd390fb1c5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Speed up project re-resolving by skipping the loading from file.Christian Kandeler2014-07-161-38/+29
| | | | | | | | When re-resolving an existing project, the build graph already exists in memory and does not have to be read from disk. Change-Id: Icf5cf7396a859d4ee1c495b8cc4fa7a1ee61ff1d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* deprecate Artifact.fileName in favor of Artifact.filePathJoerg Bornemann2014-07-163-3/+3
| | | | | | | | This property is actually a file path, not a mere name. Task-number: QBS-579 Change-Id: I04e8f03eac97b5f86fe743a4923888a3d2a82c5d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Put a system-wide lock on the build directory.Joerg Bornemann2014-07-163-1/+35
| | | | | | | | | | | | | So that two qbs instances can't overwrite each other's build graphs. In practice, this is probably most relevant for IDEs, as these hold a build graph for potentially long periods of time. Facilitates QLockFile that was introduced in Qt 5.1. For older Qt versions, no locking happens. Task-number: QBS-162 Change-Id: Ib598617fb1742eb57b6a017f40b9631d1d54e627 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add and make use of convenience item QtGuiApplication.Christian Kandeler2014-07-141-2/+1
| | | | | | | | | | Using this item, building a Qt gui app against a static Qt will work out of the box. Also add the less useful QtApplication for completeness. Change-Id: Idca1dbd3085659ebaf563f7df89f73b9daaf7001 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove qbsSettings() functionJoerg Bornemann2014-07-091-7/+6
| | | | | | | | Don't use a special Settings shared pointer. This simplifies the code a lot. Change-Id: I974cf9634d1760633744b1ed3cc18a9458ae2caf Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Make it possible to set profiles per product.Christian Kandeler2014-07-025-2/+138
| | | | | | | | | | | Use case 1: Build product A for architecture X and product B for architecture Y (e.g. host tools vs target libraries). Use case 2: Build product A for architectures X and Y and product B only for architecture X (e.g. Android multi-arch packages). Change-Id: I2eb721c37cdd12c298ee12bad60e21e94b04676b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Yet another timeout increase for the "infinite loop" autotest.Christian Kandeler2014-07-021-2/+2
| | | | | | | | Even slower machines have appeared. Task-number: QBS-628 Change-Id: I1e54a50265db4ef924d83e3485f8681fe3452480 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Properly treat "usings" as inputs when applying rules.Christian Kandeler2014-06-022-5/+0
| | | | | | | | | This allows non-multiplex rules with only "usings" and no "inputs" to work as expected, that is they create one transformer per "usings" element. Change-Id: Iba5144f81b082043878f3eefc111846b6d05646a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix "Add Files" functionality.Christian Kandeler2014-06-022-0/+37
| | | | | | | | This was broken for the case of a product with no existing binding, even accessing a null pointer. This is also covered by the autotest now. Change-Id: I088dbac08627b08f903dbe77bd824997592adb09 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add the settings directory to the project setup parameters.Christian Kandeler2014-05-261-1/+0
| | | | | | | | | This way, the settings become available for use in the qbs library, which means it can, for instance, expand the build configuration itself instead of putting this burden onto the API callers. Change-Id: I09e6067990ac2b7c2238951f9759fe52dc51b6f9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Sanitize the project setup API.Christian Kandeler2014-05-231-4/+2
| | | | | | | | | | | Ever since we introduced "overridden values", the setter for the build configuration has been pretty much an empty shell, containing only the build variant and the profile. We now make that explicit, resulting in a less confusing API that does not expect the caller to know how to encode profile and build variant information in a QVariantMap. Change-Id: I60183fc1884a884c9ceba34d7eb460c261be47ca Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix inheritance for Groups with the same fileTagsFilterJoerg Bornemann2014-05-191-1/+0
| | | | | | | | | Discard any Group with the same fileTagsFilter that was defined in a base file. Task-number: QBS-424 Change-Id: I51f0c317f36ae953cc3e777ed4e5426c9b6ddc9d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Merge remote-tracking branch 'origin/1.2'Joerg Bornemann2014-05-151-2/+2
|\ | | | | | | Change-Id: I0fb9bb82e951ef10737013886c2b893b5444bc6d
| * Autotests: Increase timeout for "infinite loop" tests.Christian Kandeler2014-05-091-2/+2
| | | | | | | | | | | | | | | | This is a bit of a shot in the dark to fix a non-reproducible test failure on our build machine. Change-Id: I8923c8744e3f5febb55a508a88c46f0fc9543da5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Merge remote-tracking branch 'origin/1.2'Joerg Bornemann2014-04-284-8/+33
|\| | | | | | | | | | | | | | | | | Conflicts: qbs_version.pri share/qbs/modules/cpp/msvc.js version.js Change-Id: Id00deaf66737efd0e35230e2bddd41de1a6de60d
| * Increase timeout in tests.Christian Kandeler2014-04-161-2/+2
| | | | | | | | | | | | | | Some build machines take a bit longer. Change-Id: I65fba2c024e95350c427286b5bcfa0feb2a7ee04 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * Prevent user code from hanging qbs during resolving.Christian Kandeler2014-04-163-4/+24
| | | | | | | | | | | | | | | | | | Long-running commands are handled already, but badly written project files could still hang qbs with e.g. infinite JS loops on the right hand side of a binding. Such code can now also be interrupted. Change-Id: Ie0d114bd37d540e764d5ec5bb323c91bfd64a67a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * Fix "inifiniteLoop" test for Qt 4.Christian Kandeler2014-04-151-1/+7
| | | | | | | | | | | | | | QThread::sleep() is protected there. Change-Id: If7b6dbabd594c0a0eaf4ea2b7c691c7e9c00c55a Reviewed-by: Christian Stenger <christian.stenger@digia.com>
| * Allow long-running commands to be canceled.Christian Kandeler2014-04-151-2/+1
| | | | | | | | | | | | | | | | | | | | At the moment, canceling a build waits for the current command to finish, which means that a badly behaving process or piece of JavaScript code can block qbs indefinitely. Task-number: QBS-552 Change-Id: I8ac23f068dd6083905a9681097da6b970c0b646b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Expose in the API whether a product can be run.Christian Kandeler2014-04-223-0/+32
|/ | | | | | | | The list of target artifacts is typically not yet available after resolving, but we already know the product type. Change-Id: I8bf98901b4123197b8d8b9ac4a4b351f251ee987 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make "infinite-loop" test app not actually run infinitely.v1.2.0Christian Kandeler2014-04-142-2/+4
| | | | | | | Otherwise, a failing test will leave a CPU-burning process behind. Change-Id: Ie9cb2e608f0cb3f1e1ad7491948666f8ac6fc87c Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* Add (failing) autotest for QBS-552.Christian Kandeler2014-04-116-1/+95
| | | | | Change-Id: Idea84b324ddccc62721ff0025ffb85c55dd82a80 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix "build single file" and "changed files" functionalities.Christian Kandeler2014-03-261-4/+3
| | | | | | | | | | | | | | | | | | | | | | | These had several problems. Firstly, the "changed files" case was implemented by setting all artifacts to "Built" and then setting the ones to "Buildable" that were reachable bottom-up from artifacts corresponding to the respective files. This approach broke with the introduction of rule nodes, because parent nodes do not necessarily exist yet at initialization time. This was not caught due to the lack of an autotest. Secondly, the logic behind the "build single file" functionality was faulty. The assumption was that this could be implemented on top of the "changed file" functionality, which is wrong: Consider the case where you have several cpp files that have not yet been built. Now marking one of them as changed and filtering by the "obj" tag will still cause all of them to be compiled, as we cannot simply exclude all other source files from being built, which would break the build for the normal "changed files" case without tag filtering. Therefore we need a dedicated list of input files by which we can filter transformers. Task-number: QBS-537 Change-Id: I47e2ba6d0cbd073561064640eaf8f63c4e0b39fa Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add XFAIL autotest for QBS-537.Christian Kandeler2014-03-246-2/+36
| | | | | Change-Id: I98aa65cee4e448efa6b9ab32f2165e4cc77429ec Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Normalize signal/slot signaturesOrgad Shaneh2014-03-031-2/+2
| | | | | Change-Id: I88e51bf4c33bbeeacb22a94b735d1faf4f76023f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do not put the plugins where the resources are.Christian Kandeler2014-02-251-1/+1
| | | | | | | | | | | That's not where they belong. Also make less assumptions about the file path leading to them. Ideally, we should also do the latter for the stuff in share/, but then someone would have to touch the horrific qmake code in static.pro. Task-number: QTCREATORBUG-10074 Change-Id: Ide9c4b83dcf0cd7a62b57643b79caf05662358cb Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Allow the user to specify a custom place for settings.Christian Kandeler2014-02-211-1/+1
| | | | | | Task-number: QBS-509 Change-Id: I4ad32c648121068880d652e3ba39d4eea59dfbc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do not cache external project data.Christian Kandeler2014-02-181-1/+9
| | | | | | | | Always retrieve it anew, as information about targets can change due to building. Change-Id: I7b15f8bc50f7b22ea1351e66b5a4b22ea83f34d1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* support transformers with an unknown number of outputsJoerg Bornemann2014-02-131-1/+22
| | | | | | | | | | | | | | | | To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A RuleNode class is introduced that represents a rule in the build graph. Rules are applied in the build phase and not in a pre-build phase anymore. The handling of moc has been revisited. The fixed automoc pre-build phase is no more. This is the squashed merge of a feature branch. Task-number: QBS-370 Change-Id: If27cdc51cba8c9542e4282c2caa456faa723aeff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Do not match files in build directories as source files.Christian Kandeler2014-01-276-0/+23
| | | | | | | | This can currently happen if the user builds in the source dir and uses recursive wildcards. Change-Id: I5f3be03313640af046478ca55a381f14605176d4 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Move knowledge about Qt modules into libsetupqt.Christian Kandeler2014-01-161-3/+5
| | | | | | | | | | | | | | In addition, we make less hard-coded assumptions than before, instead generating almost all modules dynamically from the respective Qt installation when setup-qt is being run. This way, qbs does not have to know about all the modules beforehand, and only the Qt modules that are actually present will have qbs counterparts, making it possible for project file authors to make use of soft dependencies for Qt modules. Task-number: QBS-479 Change-Id: Ie20d2acf249cd159ce4caff2ede4721ab879fad2 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2014-01-151-7/+11
|\ | | | | | | | | | | | | | | Conflicts: tests/auto/blackbox/testdata/trackExternalProductChanges/project.qbs tests/auto/blackbox/tst_blackbox.cpp Change-Id: I7b5e72e0a360d7e5e814a1f6e344bf11eac767e6
| * Fix API test.Christian Kandeler2014-01-141-6/+10
| | | | | | | | | | | | | | | | | | The test project now has more than one installable file, so we can no longer assume that the first one is the application. Change-Id: I6059362c691912cafa46caa948d6b22baa9a289e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
| * Take source artifact properties into account when change tracking.Christian Kandeler2014-01-141-1/+1
| | | | | | | | | | | | | | | | | | When properties on source files change, rules might have to be re- applied and the installation of the respective source file may have to be re-done. The current code catches none of that. Change-Id: I7d87eb1d6bbb9918f2633ec8cbb9640ca23b90a4 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Move Qt profile setup into a dedicated library.Christian Kandeler2014-01-101-1/+1
| | | | | | | | | | | | | | | | Otherwise all changes to the implementation will have to be duplicated in IDEs. Change-Id: I61e6d4fa1ee9b724eb5d9de9f233dc915a6c8bc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2014-01-092-2/+2
|\| | | | | | | Change-Id: Iccf01f1dad3fca4a78c7d9b795fdef6df0181e9b
| * Incremented year in copyright infoRobert Loehning2014-01-082-2/+2
| | | | | | | | | | | | Change-Id: Ib7f9a00bb891fa39c5bc1f891ddbfba1e4d23227 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Allow directories in "references" properties.Christian Kandeler2013-12-0511-0/+50
| | | | | | | | | | | | | | | | | | | | | | Such a construct will work if the given directory contains exactly one project file, identified by the ".qbs" extension. This saves annoying redundancies of the form "references: 'mysubproject/mysubproject.qbs'". Change-Id: Ief0f52f788189b7fb2e4764b692159b570fe444c Task-number: QBS-454 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Lock the build graph while jobs are running.Christian Kandeler2013-11-251-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All jobs except setting up the project are mutually exclusive, and it is also forbidden to change the project internally while they are going on. Currently, ignoring this requirement leads to undefined behavior. Since we can detect such a condition and react in a defined way, we should do it. Note: This is about the API and the in-memory build graph, not about competing accesses to the stored build graph from different processes. That's a different (and more difficult) problem. Change-Id: I2d8a715334b2b73b4f4d32781d0b4f83b1612d40 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | API: Add the ability to remove groups.Christian Kandeler2013-11-251-0/+17
| | | | | | | | | | Change-Id: Ic0d7a9f4976e87ab1894bb3a34372c0a27b087fe Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | API: Allow to remove files from a product.Christian Kandeler2013-11-251-3/+38
| | | | | | | | | | | | | | Task-number: QBS-20 Change-Id: Ia8b8c4745e8e68ec219e16876fb630d02453425b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | API: Allow adding files to a group with a directory prefix.Christian Kandeler2013-11-213-3/+32
| | | | | | | | | | | | | | This case is not problematic. Change-Id: I388df6180b231364a8e185eb85aee5adff417965 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | API: Allow adding to a non-literal files list.Christian Kandeler2013-11-211-3/+2
| | | | | | | | | | Change-Id: I03153c3ace25c28fbd8490a4e054772b3112a867 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>