[Development] Tests, Shadow-Build and Cross-Compilation

Rohan McGovern rohan.mcgovern at nokia.com
Tue Jan 31 00:34:06 CET 2012


Holger Hans Peter Freyther said:
> On 01/29/2012 09:21 PM, Olivier Goffart wrote:
> 
> 
> >> The other part/wish would be to always have deployment targets for the
> >> testcases and generate a run script or such as part of the installation.
> >
> > There is QFINDTESTDATA and QTest::qFindTestData that have been added recently,
> > I think for this reason.  Have you heard of them?
> 
> hi,
> 
> no I did not hear of it, when trying to resolve the shadow build issue in 
> xmlpatterns i just grepped qtbase/tests and the SRCDIR solution popped up.
> 
> Sadly QFINDTESTDATA is not enough for xmlpatterns, e.g. the checkxmlfiles test 
> will try to find all .xml/.ui/.xhtml/.qrc... files in the module (this also 
> means that by moving this test out of Qt there is less test data).
> 
> The xml patterns test uses QDir(QL1String("../../../")) to find the files 
> recursively and QFINDTESTDATA determines that this will work with the build 
> directory. Should we just call it a crappy test as the testdata is not well 
> defined?
> 

I would say that the test is broken.
It is valid sometimes to have tests scanning the source tree like this,
but in that case they must gracefully disable themselves when the source
tree is not available.

> 
> The other question is _should_ all tests be deployed or how do you plan to run 
> tests on the device?
> 

Shane mentioned in Qt4 we were using DEPLOYMENT and a tool to parse that
from the .pro files for WinCE and Symbian deployment.

MeeGo/Harmattan use packaging (rpm or deb) for all deployment.  In that setup,
to run tests on a device you need to make sure that the test and its
testdata all install themselves during "make install".  That seems to be
becoming (or already is) the standard method of test deployment in Qt5.

So, basically, all tests should either install themselves and all their
testdata, or should install nothing (which can be interpreted as
flagging the test as undeployable).



More information about the Development mailing list