aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared.h
Commit message (Collapse)AuthorAgeFilesLines
* qt6: do not use deprecated QByteArray::operator(QString)Ivan Komissarov2020-11-031-1/+4
| | | | | Change-Id: I62cdb64182cc9226bfecc00765e8197e4a1fd441 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add blackbox examples testIvan Komissarov2020-05-281-0/+2
| | | | | | | | | | It is necessary to build examples with different profiles pretty much like it is done with other tests. Thus, build examples as a separate blackbox test. Change-Id: If4e910fb60a6d51e1a0c690e7a4ece4b17bd5b95 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* setup-toolchains now sets the qbs.toolchainType, not qbs.toolchainIvan Komissarov2020-03-091-4/+13
| | | | | Change-Id: I21f0626a093db358f8f5dfa6248672c44edc82e2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Introduce QBS_TEST_SOURCE_ROOT environment variableRichard Weickelt2020-02-271-0/+26
| | | | | | | | | | | | | | | 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>
* Apply 'modernize-make-unique' fix-itIvan Komissarov2019-11-281-1/+1
| | | | | Change-Id: I93783cfa3267f69237b0ad888d0747e4272cda0a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Introduce the session commandChristian Kandeler2019-09-181-4/+6
| | | | | | | | | | Offers a JSON-based API for interaction with other tools via stdin/ stdout. This allows for proper qbs support in IDEs that do not use Qt or even C++. Change-Id: Ib051a40b7ebe1c6e0c3147cca9bd96e7daec1fde Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Merge 1.12 into masterChristian Kandeler2018-07-061-0/+12
|\ | | | | | | Change-Id: I616949b321c26699ada0f2ae81b20a88db40b610
| * Autotests: Allow to parameterize the "file unlock grace period"Christian Kandeler2018-06-291-0/+12
| | | | | | | | | | | | | | | | ... via the environment. This should help reduce false positives in our CI. Change-Id: I28492b4e476289f2d9418a272b167d9a679ebc5f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Make the texttemplate module publicJoerg Bornemann2018-06-011-0/+75
|/ | | | | | | | | | | Also, adjust the syntax to be closer to ES2015's template literals. [ChangeLog] Introduced the texttemplate module, a facility similar to qmake's SUBSTITUTES feature. Task-number: QBS-1050 Change-Id: Id4d45ac962d68f44a060aefafb20263d7f21ba9f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.11 into masterChristian Kandeler2018-02-161-3/+5
|\ | | | | | | Change-Id: I9603ade37a1f839019c9219c940dcbb95c1cac89
| * Autotests: Fix function that figures out the object file extensionChristian Kandeler2018-02-161-3/+5
| | | | | | | | | | | | | | It did not know about qbs.toolchainType. Change-Id: I00bcd5518f81a65fa49153b75f1fd2fb69d37fd3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Autotests: Add convenience function for changing file contentsChristian Kandeler2018-02-011-0/+12
|/ | | | | | | | We do that in a lot of test functions. Change-Id: I8629e8bf936bc8f45d6a42b3bfc89a6a078cd023 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Run Android autotests in release mode as well as debugJake Petroules2017-12-141-1/+2
| | | | | | | This should help catch more errors in the future. Change-Id: I54c1e4314357351af0df9fbb7ed6df36fda983f5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add qbs.targetPlatform and qbs.hostPlatform propertiesJake Petroules2017-11-221-10/+13
| | | | | | | | | | | | | | | | | This allows users to set the target platform from within project files, since it is a scalar value. The values of qbs.targetOS and qbs.hostOS are now derived from these new scalar properties. [ChangeLog] Added qbs.targetPlatform and qbs.hostPlatform properties which are scalar versions of qbs.targetOS and qbs.hostOS. qbs.targetPlatform is a "write-only" property that can be used to set the OS/platform that is being targeted, while qbs.targetOS and qbs.hostOS should continue to be used to *read* the OS/platform that is being targeted. qbs.targetOS is also now read-only. Task-number: QBS-1070 Change-Id: Id3fd206a5b2ebee2d626f3e5ab02ecd1dc90d90a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix object filename test helper function to work with profile:noneJake Petroules2017-11-201-2/+3
| | | | | | | | | The default Windows toolchain is MSVC, so if the profile doesn't set qbs.toolchain, use ".obj" as the object filename suffix if the host OS is Windows. Change-Id: Iaaee21ee3e80bc3ec532aac770c10a9378321e91 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use empty() instead of isEmpty()Jake Petroules2017-11-161-1/+1
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Iab6d46dcc3be246d1650aae2b1730f933b717be8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Allow overriding the autotest profile for each test suite individuallyJake Petroules2017-11-151-0/+4
| | | | | | | | | | For example, this allows a Qt profile to be set only for the Qt test suite, which avoids default profile properties "polluting" the results of other test suites. Change-Id: Ie6eb7131a9ce6b90c21b4e33e41f8f32df0e01e8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Autotest: Create a convenience header for DLL import/export macrosChristian Kandeler2017-10-231-0/+8
| | | | | | | | | It's annoying having to write this again for every autotest involving shared libs. Change-Id: Ief6a11f8df2810166606874d24bfa9820af00d16 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Allow overriding the Qbs autotest profile with an environment variableJake Petroules2017-08-161-1/+6
| | | | | | | | | | | | The default profile is now "none", ensuring that Qbs autotests will use a clean environment by default. This means that development can be done entirely within Qt Creator without having to separately configure Qbs from the command line. It also has the advantage that switching test profiles is much easier, for example in order to allow running the entire test suite for a cross compile target. Change-Id: I17b06952b577bfef9818338b59dd638492612e24 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Autotests: Ensure that waitForNewTimestamp() always terminatesChristian Kandeler2017-07-311-3/+8
| | | | | | | | | | Apparently, the abovementioned function has been observed to run seemingly forever in certain environments. Fix that by no longer requiring an actual file timestamp change for it to terminate. Task-number: QBS-1169 Change-Id: I9798309d179b0b6f8857ca8a4a5c1236ca162c27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Autotests: Provide a means to specify the timeout via the environmentChristian Kandeler2017-06-221-0/+9
| | | | | | | | There are some exceedingly slow test machines for which sometimes even our generous default timeout is not enough. Change-Id: I278f3e3c6c85ed65ba24312e0788aa4bfa323dd2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove the profile name from the unique product nameChristian Kandeler2017-06-091-6/+3
| | | | | | | | | | | | | | If the product is multiplexed by profile, its name is already uniquified by the multiplex id. If the product is not multiplexed, we don't need to make the name unique. This removes references to the top-level profile name from the build directory structure, which can be helpful when rebuilding with a different profile name, but the same effective properties. Also, it shortens the paths of generated artifacts in the common case. Change-Id: I1586049b9650542732a64be4b7d5f2db4428d87e Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Switch to a new multiplexing approachJoerg Bornemann2017-05-231-4/+15
| | | | | | | | | | | [ChangeLog] Added a more general way of multiplexing products to properly support the creation of collections of multiple variants of the same product, e.g. macOS bundles and Android packages. Task-number: QBS-192 Task-number: QBS-912 Change-Id: I943aaa70953bf8c7726fe1b2bbb9b4d5a25f083c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Support providing a settings directory to the autotestsChristian Kandeler2017-05-101-4/+14
| | | | | | | | This allows us to run several instances of an autotest in parallel for the same qbs version. Change-Id: I17652ffeba01679800f30fe73d033f7f10e2ded5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-7/+8
| | | | | | | | | | | | | | | | By using q<lowercase>.h headers, we become more bootstrap-friendly, as no full syncqt is required any more. In the same go, prefix all includes with the module name. This helps grep-based analysis of which parts of Qt are used and where. It's also consistent with Qt's public headers (where syncqt enforces the style). Testdata and examples are excluded from the change, as they are not relevant for bootstrapping. Change-Id: I9539b1d795e87fca6e5fc6c91acbb775b79208d9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update license headersIikka Eklund2016-08-291-17/+15
| | | | | | | | | | Patch-set 1 includes *.h Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ib6cf3ac47dfba6dff262fded44bc952aef3bda8b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge 1.5 into 1.6Jake Petroules2016-06-281-2/+2
|\ | | | | | | Change-Id: If1a2c368170d89d5e6e11b08a32b37901d51eb1d
* | Fix detection of target OS in autotests.Christian Kandeler2016-06-211-0/+18
| | | | | | | | | | | | | | | | | | | | | | The code assumed that qbs.targetOS was specifically listed in the profile, which is not (no longer?) the case. Fix two autotests that broke some time ago, which went unnoticed because they had erroneously been skipped. Change-Id: I30a7478e2a51838089db36e4fe19143c210885fe Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Stop special casing qbs.buildVariant in command line handling.Jake Petroules2016-06-201-6/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces qbs.configurationName, which takes the place of qbs.buildVariant in the command line and acts as a unique identifier for each build configuration, rather than relying on the combination of qbs.buildVariant and the profile name to do so. No longer special casing qbs.buildVariant allows the variant to be decoupled from the build configuration, and allow scenarios where a project may contain products hardcoded for particular build variants, and in future, special debug-and-release builds which create a single framework product containing multiple build variants. Incidentally, this change allows building multiple configurations of the same build variant and profile name combination, since the build configuration is no longer keyed on the aggregate of those values. Building for different profiles with the same configuration name in parallel is now no longer possible, but this is easily worked around by simply specifying different configuration names for such combinations. For example, the following is now possible: qbs \ static profile:a qbs.buildVariant:release project.useStaticLibraries:true \ dynamic profile:a qbs.buildVariant:release project.useStaticLibraries:false [ChangeLog] Each build configuration now requires a unique name, which is specified on the command line in the same place that qbs.buildVariant used to be specified. This allows building for multiple configurations with the same variant. Change-Id: I96ab9fc96861ab7e6a04a7d291a093115c22010e Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make waitForNewTimestamp() function safer.Christian Kandeler2015-07-131-9/+15
| | | | | | | | | | Don't just wait for a new value from time(), but actually verify that a *file* will get a new timestamp, as this is what matters for qbs. Change-Id: I4df0eaba57523fd6794f53a32bb96ab868abce8c Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Android: Add more test cases.Christian Kandeler2015-02-051-4/+9
| | | | | Change-Id: Ie6afa5c46d20cd6322a46a53e02e9d7108727c95 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Merge branch '1.3' into 'master'Christian Kandeler2015-01-281-6/+6
|\ | | | | | | | | | | | | | | | | Conflicts: doc/reference/jsextensions/jsextensions-general.qdoc src/lib/corelib/language/evaluatorscriptclass.cpp src/lib/corelib/language/evaluatorscriptclass.h Change-Id: Ic9b77b56e8fc8bf93e0a553930757de8c93fed22
| * Update LicenseEike Ziller2015-01-261-6/+6
| | | | | | | | | | Change-Id: I092fca9f950de1ba38826c33b155f86feae2770b Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Fix framework bundle construction and add an autotest to prove it.Jake Petroules2015-01-221-0/+6
| | | | | | | | | | Change-Id: I8c24a5a048fef9b7e0da1934d9be5a01893edbe4 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | make the test working dir configurableJoerg Bornemann2014-12-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | The test working directory can be set via the environment variable QBS_TEST_WORK_ROOT. On systems with path length restrictions (Windows, what else...) the tests might fail if you run them in a directory that's too deep. Change-Id: Ia7af8fc2c7a13171551a240d9d58e8815ecc662c Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Use a hashing function to construct output artfact file paths.Christian Kandeler2014-11-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Modules like cpp need a way to construct unique locations for output artifacts, but the current approach of duplicating the path to the input file in the build directory can lead to excessively long file paths that hit the limit on Windows. So let's hash the path to the input file instead. Change-Id: I47dcd242d0ee90c377f2a6df8e270bbefbaf082f Reviewed-by: Thomas Epting <thomas.epting@stryker.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Consolidate "safe identifier" code by introducing qbs.rfc1034identifier.Jake Petroules2014-11-041-8/+1
| | | | | | | | | | | | | | | | | | | | Instead of duplicating this logic in three places across two languages, it's now implemented in a central location in C++ and exposed to JavaScript. As an intentional side effect, build directory naming now uses - instead of _ as per the RFC 1034 name charset. Change-Id: I1a7c3ec45efc5b29f9a05067e4c2cf640af4a7aa Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | remove support for building qbs with Qt <= 5.1.0Joerg Bornemann2014-10-291-6/+0
| | | | | | | | | | Change-Id: I058eedd2d9dcaad1eaac1f4407f4f698133a774b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Merge remote-tracking branch 'origin/1.3'Joerg Bornemann2014-10-161-7/+8
|\| | | | | | | | | | | | | | | Conflicts: qbs_version.pri version.js Change-Id: I645b2f37bae9d36d4bca54b267d57df8b0b7fd21
| * complete license header updateJoerg Bornemann2014-10-161-7/+8
| | | | | | | | | | Change-Id: I2c7ea3242e5ce244e8feee01c0f8a0b0651fa0d4 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Merge remote-tracking branch 'origin/1.3'Joerg Bornemann2014-10-101-0/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qbs/modules/cpp/GenericGCC.qbs src/app/qbs-setup-toolchains/probe.cpp src/lib/corelib/buildgraph/buildgraph.cpp src/lib/corelib/language/language.cpp src/lib/corelib/language/language.h tests/auto/api/tst_api.cpp tests/auto/blackbox/tst_blackbox.cpp tests/auto/blackbox/tst_blackbox.h Change-Id: Ie337cd6b55ec1de4f906cb8311959eeb7bc6d686
| * libqtprofilesetup: Fix mingw use case.Christian Kandeler2014-09-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | - Don't assume the mkspec has "mingw" in its name. - Relax overly pedantic tests in gcc.js: If a library name is an actual file path, then use it as one, regardless of what it looks like. - Some autotest adaptations. Task-number: QBS-688 Change-Id: I1d0d51b04ae81d4c10f8cdcc18d6447233e44863 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Use modified product names for build directories.Christian Kandeler2014-08-201-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Users should be able to use any product name they want. In particular, they should not be limited by what the file system supports; this is why we have the "targetName" property. However, we currently subvert this by using the product name as-is in the build directory. Instead, we now use a super-safe version of the product name consisting only of selected ASCII characters and make it unique by appending a hash of the original name. Change-Id: I3acf06d83a1c8a8c0a4716a7ac47a5bf8652075d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Turn some blackbox tests into API tests.Christian Kandeler2014-08-141-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Different test executables can run in parallel, whereas the functions within one test executable cannot. This means that tst_blackbox is currently a bottleneck, as it takes an order of magnitude longer than all other tests combined. We therefore turn a number of blackbox tests into API tests (most tests work equally well in either). The run-time of these two test executables is now about the same, and as a result, the time it takes to run "make check" has almost halved. Change-Id: I55ef43a60588f86a8438bdecb7795aca0880efd0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Speed up autotest execution on Unix.Christian Kandeler2014-08-111-3/+12
|/ | | | | | | | | | Make use of the fact that waiting for a new timestamp takes on average considerably less time than the full resolution. Also remove some calls to waitForNewTimestamp() from a test where that made no sense at all. Change-Id: I8728d5de63411f1048218749854a48a70bc14630 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Autotests: Make "copy and touch" operation atomic.Christian Kandeler2014-08-011-0/+19
| | | | | | | | | 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>
* Tests: Move waitForNewTimestamp() function to shared file.Christian Kandeler2014-07-301-0/+51
We want to use it in the API tests too. Change-Id: I8fad090ea98f67e50b7b2a8e3854c5b618172364 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>