[Qbs] Qt Quick Tests and custom import paths

Federico Frenguelli synasius at gmail.com
Thu May 17 11:27:33 CEST 2018


> What do you mean by that?
>
> > Is it possible to access a product's properties from the artifact?
>
> Artifact objects have a "product" property, which gives you the product
> object.
>

My idea was to define a custom property in the test Product like the
"qmlImportPaths" property that is used
by Qt Creator to resolve imports.
The problem is that I can't retrieve the value of a custom property from
the artifact, even through its "product" property.

This is an example:

In the test:

    CppApplication {
        name: "tst_planets"
        type: ["application", "autotest"]

        property stringList arguments: ["-import", "qrc:/qml"]

        // ....
    }

and in the test runner:

    ...
    Rule {
        ...
        prepare: {
            var commandFilePath;
            var installed = input.moduleProperty("qbs", "install");

            var additionalImportPaths = input.product.arguments;  // This
one returns undefined!
            ....
    }

That would be a more flexible alternative to the one based on a custom
module, but I can't find a way to retrieve that value.

-- 
Federico Frenguelli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20180517/d8b64665/attachment.html>


More information about the Qbs mailing list