In fact, it is quite troublesome to do TDD over QML. Although Qt has provided the Qt Quick Test module, it don't support dummydata like Qt Quick Designer. I have tried to run tst_xxx.qml via the C++ test framework but it can not use the TestCase object. It depends on QTestRootObject which is a private class.
So now I could only use Qt Quick Test to test module which don't relay on context object . For other module , I would let the C++ test framework to setup an environment with dummydata loaded , then execute the QML module. However, it just used as a gallery of widget . It show how the component looks and the interaction with user. It will report if there any error raised during execution . No any detailed tests are carried. On 5 May 2014 14:50, Luca Bonifacio <luca.bonifa...@bbv.ch> wrote: > Hi guys > > Is there somebody which has some experiences by doing TDD with QML? How do > you mock QML components? > > > -----Original Message----- > From: Alan Alpert [mailto:4163654...@gmail.com] > Sent: Samstag, 3. Mai 2014 01:30 > To: Luca Bonifacio > Subject: Re: [Interest] Project structure for multi-platform mobile devices > > On Fri, May 2, 2014 at 5:47 AM, Luca Bonifacio <luca.bonifa...@bbv.ch> > wrote: > > Hi Alan > > > > Thank you for your answer. Yes, that's correct. I could write a new > component with the same name as the object in C++, but then I have the > disadvantage that all those files are stored together my application source > files, which isn't so nice. I would prefer to mock the C++ objects from my > unit test project. Do you have already used TDD on complex projects? If > yes, how do you do that? > > The dummydata files can be anywhere, as long as they're in one directory. > Obviously, if you mock the C++ objects in C++ instead of QML then they > exist near your custom test launcher. > > There was another guy who was doing TDD with QML on complex projects. > But since you replied to me, and not the interest list, it will be hard > for him to provide his feedback. > > -- > Alan Alpert > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest