aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/cmdlineparser
Commit message (Collapse)AuthorAgeFilesLines
* qbsbuild: move logging to the static libraryIvan Komissarov2020-08-201-0/+1
| | | | | Change-Id: I94bd7288a9ef3b7a785a76386ff7d395cdd01f81 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Initial CMake portIvan Komissarov2020-08-171-0/+23
| | | | | | | | | | | | | | | | | | | This change allows to build Qbs using CMake build tool Tested platforms - Linux (gcc) - macOS (clang) - Windows (msvc2017) Missing features (compared to Qbs build) - Documentation build - Bundled QtScript support - Static build - .pc file for qbscore - qbs module for qbscore Change-Id: I09b5dadd6723d5a47e5ef2a9a38d3300488718f2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace QRegExp by QRegularExpressionChristian Stenger2020-07-231-1/+0
| | | | | Change-Id: I6c86565b8464efd0b7aec61c12879d3b95a5871c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add "show progress" support on WindowsAndreas Zieringer2018-10-301-8/+5
| | | | | | | | Should work with all console types. Fixes: QBS-1407 Change-Id: I5144469d70d79a263f9960092abda9a3d83462a1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use push_back() instead of append()Jake Petroules2017-11-221-2/+2
| | | | | | | | | | ...or operator<< if the argument was itself a list, or brace init where appropriate. This is a simple find and replace with manual sanity check. Change-Id: I94b79cbf3752192dd258001bf1dfcd46f58ca352 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Give the setupRunEnvironment script an additional parameterChristian Kandeler2017-11-221-0/+3
| | | | | | | | | | | Required by follow-up commit. [ChangeLog] The Module.setupRunEnvironment script now has a new parameter "config". Users can set it via the --setup-run-env-config option of the run command. Change-Id: I1be57fcff5321874cf3dcf4fb3a7ef7d6f69a8a5 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* STL compatibility: use size() instead of count()Jake Petroules2017-11-151-8/+8
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Ia733befe7885dc3c643d5c84e151312bfd86a3c6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use front() instead of first()Jake Petroules2017-11-141-10/+10
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: I82f0eb38b6a5a3b75a4ed38d97bdb6ce164d09b3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix build with Qt < 5.9Christian Kandeler2017-11-081-16/+16
| | | | | | | | Somebody added QTest::addRow() in addition to QTest::newRow() to confuse people. Change-Id: I8779e3dfb20f97a1c3ccdf39e2c31dfe7ac0efa5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CLI autotest: Give testInvalidCommandLine a _data functionChristian Kandeler2017-11-071-16/+28
| | | | | | | | The code is always the same, only the command line changes. This also turns code comments into proper, user-visible test descriptions. Change-Id: I3bef35d8bf8684524c494d487176695340d3adc1 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* CLI autotest: Factor out common codeChristian Kandeler2017-11-071-33/+36
| | | | | Change-Id: I75366c7326c7745d1e7a406aeab987be1cfba380 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CLI: Fix the --version optionChristian Kandeler2017-11-071-0/+9
| | | | | | | | | | This option was supported in a very hacky way by attaching it to the "build" command, where it does not belong. Add a dedicated command instead and support the option variant in the same way as we do for --help. Change-Id: Ib8f1a0e44f9ae669093f059c86518138df510bc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CLI: Allow to mix options and property assignmentsChristian Kandeler2017-11-071-5/+5
| | | | | | | | | | | | | The strict separation we had before was annoying to users wanting to add options to a previous command line using the shell history, because the new option could not simply be appended if any property assignments were present. [ChangeLog] Command-line options do not have to precede property assignments anymore. Change-Id: I46fab716b2ff045adaf138db5194c3eba5b6818b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CLI: Ensure non-applicable commands refuse to take property assignmentsChristian Kandeler2017-10-301-0/+3
| | | | | Change-Id: Ib339a2649ecf32670f2f65d0bf159dcc960214df Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* CLI: Add more test casesChristian Kandeler2017-10-301-0/+18
| | | | | Change-Id: I3024a3e826608ab1fa09bb288f524a3ef70329d1 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* CLI: Make the configuration name explicitChristian Kandeler2017-10-241-8/+9
| | | | | | | | | | | | | | | | | | | The old syntax took every non-option parameter not containing a colon as a configuration name, which was highly unintuitive. New users would always get it wrong, and experienced ones would still often encounter surprising behavior, in particular when forgetting to pass an option. For instance, this command: $ qbs build myproject.qbs # user forgot to specify the -f option would start building for a new configuration called 'myproject.qbs'. Instead, we now have a special key "config": $ qbs build config:debug [ChangeLog] Configuration names are now passed as "config:<name>" on the command line. Task-number: QBS-1158 Change-Id: I9b69a35de1f22b9b40efe6ca3616441b5f809aba Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Use Utilities.cStringQuote in qbs project filesChristian Kandeler2017-10-131-3/+3
| | | | | | | | This function has been available since 1.8. Change-Id: I0114bf8ec41f3be0c306be943d15599e09f69cc7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove the --force optionChristian Kandeler2017-09-041-3/+0
| | | | | | | | It hasn't been in use for a while now. Change-Id: I85c22d44309727ee458414cad0fb42c312030a9b Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix behavior with corrupt or outdated build graphsChristian Kandeler2017-07-105-21/+0
| | | | | | | | | | | | Commit b6bf17cfd1 introduced a glitch in that a rebuild using a build graph whose magic string does not match would throw an error at the first attempt and silently succeed at the second one. The new behavior is the same as for attempts to rebuild with property changes: A plain "build" fails, a "resolve" does the trick. Some more code had to move from the command line parser to the loader to achieve this. Change-Id: I906748cc1686c0c5d413d9451ec9e2aa26ea2035 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Introduce the qbsversion module for building QbsJake Petroules2017-06-021-2/+2
| | | | | | | | | | Use that instead of QbsFunctions.qbsVersion() and read it in qbs_version.pri; this has the advantage that simple text processing tools can retrieve the project version without having to parse JavaScript. It's also set from only one place now. Change-Id: Icfd2a6bf12b794b55c9ba31934a96b4483224eae Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Handle digits in merged short options as option parameterJoerg Bornemann2017-04-031-0/+7
| | | | | | | | | | | | The argument list ["-a123b987"] becomes ["-a", "123", "-b", "987"]. Merged short options cannot be digits, e.g. ["-7j1"] is an error. This way we can support the "-j8" option that everybody knows and loves from make and other make'ish tools. Task-number: QBS-196 Change-Id: I574d77e8f85a708708ebed43668bb3c6ca916233 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* QRegExp include cleanupSamuel Gaist2017-03-081-0/+1
| | | | | | | This patch fixes missing QRegExp includes Change-Id: I4d096d80d33f6c15cec8d70e989c69656e55c676 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Clean up [q]fileinfo.h includesJoerg Bornemann2017-03-061-1/+0
| | | | | Change-Id: I9bc57750cf67d20f7c4fc7291c38de406078e339 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add a Utilities.cStringQuote functionJake Petroules2017-01-301-0/+1
| | | | | | | | This accepts a raw string and provides a C string literal, properly escaped and quoted. Change-Id: I61a02ce07f152f36ac31bf973932a7f88406bb75 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Give the two copies command.{cpp,h} non-ambiguous namesJake Petroules2017-01-051-2/+2
| | | | | | | | | | | The pair in tools/buildgraph becomes rulecommands.{cpp,h} The pair in parser becomes parsercommand.{cpp,h} This resolves a conflict which prevented compilation of the entire set of qbs sources with MSVC and the /Fo option. Change-Id: Ic909d02a230d8e59f3bf4d00fc895bf54739961a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-3/+4
| | | | | | | | | | | | | | | | 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-16/+14
| | | | | | | | | | Patch-set 2 includes *.cpp *.c Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ie6e493097af6f7dd6a8adff170eb856f496e689e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Stop special casing qbs.buildVariant in command line handling.Jake Petroules2016-06-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace 'the Qt build suite' with 'Qbs' in copyright notices.Jake Petroules2016-06-061-1/+1
| | | | | | Change-Id: I885d94bb14b325dc36767a840ebdb0be1fb59dd2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add an option to require transformers to generate all declared outputs.Jake Petroules2016-03-091-0/+2
| | | | | | | | | | | | This ensures that a successful build cannot complete without all output artifacts of all rules and transformers in the project existing (unless they are marked alwaysUpdated: false). This is undesirable to enable by default due to the potential overhead, but can be a useful debugging tool and so is provided as an option. Change-Id: I46ee49e28cc06d5aff9a3cfd520f929fef4de3f8 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Replace --show-command-lines with --command-echo-mode.Jake Petroules2015-02-251-2/+2
| | | | | | | | | | This allows users to hide command output entirely without changing the logging level. It is also used by the generator command to hide the dry run command "executions" it performs when creating the build graph for project generation. Change-Id: I27a64c8138521001f5b62473b4a3b4ff46d8ba25 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.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>
* | qbs build: Introduce convenience item QbsProduct.Christian Kandeler2014-10-301-4/+7
|/ | | | | | | | As base product for QbsApp, QbsLibrary etc. Has little functionality at the moment, but will get more soon. Change-Id: I29ac78db2ff1ba109dd09a55e7593b2beeaba741 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* complete license header updateJoerg Bornemann2014-10-161-7/+8
| | | | | Change-Id: I2c7ea3242e5ce244e8feee01c0f8a0b0651fa0d4 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Allow the user to specify a custom place for settings.Christian Kandeler2014-02-211-35/+26
| | | | | | Task-number: QBS-509 Change-Id: I4ad32c648121068880d652e3ba39d4eea59dfbc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix command line parser tests.Christian Kandeler2014-01-281-7/+5
| | | | | | | Some of these tests succeeded for the wrong reason. Change-Id: I3b7cffb871b512aed1c41d217f58a0d1e0599ad6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib7f9a00bb891fa39c5bc1f891ddbfba1e4d23227 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* add build option --check-timestampsJoerg Bornemann2013-07-231-0/+2
| | | | | | | | | Give users the possibility to force qbs to read the physical timestamps instead of using the stored timestamps. Task-number: QBS-303 Change-Id: I6010515b5e8f97ec0b91069cbc7d8a1b0931dce5 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Prepare qbs project files for selective inclusion.Christian Kandeler2013-07-021-1/+2
| | | | | | | | | | | | Namely: - Move product "share" into its own file. - Move version number definition into its own file. This will make it easier to pull in only parts of the sources in an aggregating project (e.g. an IDE that does not need the executables). Change-Id: I41b724fe8a0b20d957b924fe0a827263add43dce Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Use private implementation in API classes.Christian Kandeler2013-05-231-2/+2
| | | | | | | | | While we do not promise a stable ABI at the moment, this is conceptually correct and has to be done sooner or later, with increasing effort the longer we delay it. Change-Id: Icc98443974e54d377167480ace601db4981ed43c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Skip non-applicable command line parser test on Windows.Christian Kandeler2013-04-121-5/+8
| | | | | | | There currently is no "--show-progress" option on that OS. Change-Id: I56150eadb69ac05d342d3a050c87e66bc79bd63f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix building for more than one configuration at once.Christian Kandeler2013-04-091-0/+41
| | | | | | | Was broken due to a bug in command line parsing. Change-Id: Ice6f5ce057a157f3d740a069ac567d75cfd38ba0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make commandline parser auto test deterministic.Christian Kandeler2013-03-271-1/+3
| | | | | | | | It no longer depends on whether it is run in a terminal. See comments in patch for details. Change-Id: I3802112bdbfdb9f2e1221a4a86d29f422c437c81 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix problems with time logging.Christian Kandeler2013-03-261-0/+8
| | | | | | | | | | | | This is an addendum to 55b848f530e18ae1f8294f05fb1971aa578dd956, which was erroneously pushed without proper testing. - Write timing data only if requested. - Do not access progress observer if it's null. - Add autotests. Change-Id: I616dc050e69478d297abb6d5a3ae27a6ccff8503 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qbs project files: Add support for auto tests.Christian Kandeler2013-03-182-3/+29
| | | | | Change-Id: I02715cda889f9f271a4372b0dec70645674f8843 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Clean up autotests.Christian Kandeler2013-02-111-12/+2
| | | | | | | | Their project files are mostly identical, so introduce auto.pri. Also remove outdated and unused test "dependencyFinder". Change-Id: Ibe7f40cf1b0e28719fbf91a905379432a0359968 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Build a shared library.Christian Kandeler2013-02-086-0/+156
We don't want our code to be duplicated in memory for each application that uses it, so the library should not be linked statically. Some ramifications worth mentioning: - The unit tests had to be moved into the library, because otherwise we would need to export random internal symbols. This is why the patch appears so big. A follow-up patch should probably make compilation of tests optional, so the library can be deployed without unneeded code. - The DESTDIR of the auto test executables is now the same as the one of all other executables, so they can all use the dll on Windows without additional setup. - Some internal symbols were exported, namely: a) Logging-related stuff. This allows us to use a uniform logging approach in the library and in our command-line tools; I consider this acceptable. b) A handful of classes and functions currently needed by certain command-line tools. These seem more questionable to me and we should probably find a different way to implement the respective functionality. Change-Id: I9cd21e12cd622b55cf62f5e04ad398734410ede1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>