Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-31 Thread Federico Frenguelli
This is amazing! And it is exactly what I am doing now using a custom module and a custom test runner! Thanks On Thu, 31 May 2018 at 11:23, Christian Kandeler wrote: > On Tue, 15 May 2018 15:19:49 +0200 > Federico Frenguelli wrote: > > > I'm writing a test for a qt quick component and I need t

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-31 Thread Christian Kandeler
On Tue, 15 May 2018 15:19:49 +0200 Federico Frenguelli wrote: > I'm writing a test for a qt quick component and I need to add "qrc:/qml" to > the qml import paths. > One way would be to add custom arguments to the AutotestRunner: > > AutotestRunner { > arguments: ["-import", "qrc:/qml"] > }

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-17 Thread Christian Kandeler
bit more involved (and requires the master branch). Christian >   > __ > > Od: Christian Kandeler > > Komu: qbs@qt-project.org > > Datum: 17.05.2018 10:25 > > Předmět: Re: [Qbs] Qt Quick Tests and custom im

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-17 Thread resurrection
Quick Tests and custom import paths On Wed, 16 May 2018 18:01:40 +0200 Federico Frenguelli wrote: > > If functions were properly supported as properties, there'd be a simple > > generic solution: > > > > AutotestRunner { > >     additionalArgsFunc: functi

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-17 Thread Federico Frenguelli
> 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 b

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-17 Thread Christian Kandeler
On Thu, 17 May 2018 10:57:31 +0200 Federico Frenguelli wrote: > On Thu, 17 May 2018 at 10:25, Christian Kandeler > wrote: > > > On Wed, 16 May 2018 18:01:40 +0200 > > Federico Frenguelli wrote: > > > > > > If functions were properly supported as properties, there'd be a simple > > > > generi

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-17 Thread Federico Frenguelli
On Thu, 17 May 2018 at 10:25, Christian Kandeler wrote: > On Wed, 16 May 2018 18:01:40 +0200 > Federico Frenguelli wrote: > > > > If functions were properly supported as properties, there'd be a simple > > > generic solution: > > > > > > AutotestRunner { > > > additionalArgsFunc: function(te

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-17 Thread Christian Kandeler
On Wed, 16 May 2018 18:01:40 +0200 Federico Frenguelli wrote: > > If functions were properly supported as properties, there'd be a simple > > generic solution: > > > > AutotestRunner { > > additionalArgsFunc: function(testArtifact) { > > var myArgs = []; > > var additionalImp

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-16 Thread Federico Frenguelli
> If functions were properly supported as properties, there'd be a simple > generic solution: > > AutotestRunner { > additionalArgsFunc: function(testArtifact) { > var myArgs = []; > var additionalImportPaths = > testArtifact.quickpaths.additionalImportPaths; > for (var

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-16 Thread Christian Kandeler
On Wed, 16 May 2018 16:43:32 +0200 Federico Frenguelli wrote: > I finally found a solution which I want to report here, so that we can > start a discussion and maybe improve the state of Qt Quick tests in QBS. > > This is a toy project that shows what I did: > > https://github.com/synasius/pref

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-16 Thread Federico Frenguelli
I finally found a solution which I want to report here, so that we can start a discussion and maybe improve the state of Qt Quick tests in QBS. This is a toy project that shows what I did: https://github.com/synasius/prefect-qtquick-tests If you checkout the first commit and run "qbs build -p au

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-15 Thread Christian Kandeler
On Tue, 15 May 2018 15:52:44 +0200 Federico Frenguelli wrote: > I'm not a QtQuick expert, but can't you just use the QML2_IMPORT_PATH > > variable? > > > > AutotestRunner { > > environment: base.concat("QML2_IMPORT_PATH=qrc:/qml") > > } > > > > I tried to use environment exactly how you pr

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-15 Thread Federico Frenguelli
Hi Christian, I'm not a QtQuick expert, but can't you just use the QML2_IMPORT_PATH > variable? > > AutotestRunner { > environment: base.concat("QML2_IMPORT_PATH=qrc:/qml") > } > I tried to use environment exactly how you proposed but somehow the value of QML2_IMPORT_PATH is processed and qrc

Re: [Qbs] Qt Quick Tests and custom import paths

2018-05-15 Thread Christian Kandeler
On Tue, 15 May 2018 15:19:49 +0200 Federico Frenguelli wrote: > I'm writing a test for a qt quick component and I need to add "qrc:/qml" to > the qml import paths. > One way would be to add custom arguments to the AutotestRunner: > > AutotestRunner { > arguments: ["-import", "qrc:/qml"] > }