[Qbs] Build QTests from single Product

Jake Petroules Jake.Petroules at qt.io
Wed Nov 8 17:15:01 CET 2017

The simple answer is that multiplexing is limited to those 3 properties right now for technical reasons. In terms of the design concept, I certainly would have liked to allow it to work over ANY property, but we ran into limitations with the implementation.

At least right now, it's technically possible to add an unlimited number of multiplexing axes simply by modifying common.qbs (i.e. it requires no changes to the engine), but only properties of the qbs module can be multiplexed, not others. So something like Product.files/Group.files is out of the question at least for now.

If you can argue for multiplexing over a particular qbs module property, feel free to propose a patch and we may consider adding it.

> On Nov 8, 2017, at 12:28 AM, resurrection at centrum.cz wrote:
> In other testing frameworks like Google Test the test executable typically contains all test cases for the given module under test so there typically are as many products for tests as there are production modules. With QTest this is unsupported (although doable) and for good reasons too (mainly separation of test runs). As a result this requires each test case to be a separate executable and thus a separate Product under Qbs. While some code duplicity could be avoided by extracting most of the qbs code into custom item and instantiating that, the issue of the project list and the running executable(s) lists will be absolutely cluttered with every class being a separate Product (think Qt itself or even Qt Creator projects). Now the multiplexing sounds just like the right thing for this as one could pass the `files` property to `multiplexByQbsProperties` and it should work as expected building an executable for each file. Unfortunately that is not currently possible as `multipl
> exByQbsP
> roperties` is limited only to one of `["architectures", "buildVariants", "profiles"]`.
> Incidentally this hints towards what I would absolutely love to see in Qbs and that is kind of there but not quite - dynamically defined Products. The multiplexing is just that - you defined a product and told Qbs to build it n times with these different settings. Custom items are almost that with the big limitation that you have to actually instantiate them manually rather than based on some property(ies). The QTest issue is a variation on this: "build this Product for every file in this list". Currently I need to go and instantiate the custom item manually for each test case. And it could be pushed a bit further by being able to say build this Product for every directory in this list with files being extracted dynamically etc. That would essentially remove the raison d'ĂȘtre for the qbs-autoproject that is doing exactly that - moving from manually defining each product to defining rules for a product type/category letting the build system to extract the project/products and
>  build t
> hem.
> So my ultimate question I guess is what are the plans regarding multiplexing? Will it be expanded into more general Qbs feature or kept limited to the special (Apple mainly) use case(s)? And what about the QTests?
> Best wishes,
> Michael
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs

Jake Petroules - jake.petroules at qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io

More information about the Qbs mailing list