Hi,

I'm currently working on a QML only app for Sailfish and want to write some 
unit tests for it. For that I'm using QtTest quick component.
Are there some other devs doing UnitTests on their QML apps? Are you using 
QtTest, too?

One important question there is how to structure the project wit its tests? I'm 
currently using a project structure recommended by Artem Marchenko [1] which is 
the best I could find. It puts the tests into an own subpackage so they're not 
distributed in the release builds. But this approach still has its problems: 
You have to change import paths for autocompletion in QtCreator to work, but 
have to change them back again for a build to succeed. Furthermore, this 
approach ist still quite complex.
So which project structure and approach for running tests are you using?

The 3rd point is just pro-forma as I expect there is no comfortable solution 
for that problem: One feature I'm developing needs a database migration. I want 
to test this migration by providing a pre-migration test db, executing the db 
and checking the result. But QtQuick.LocalStorage doesn't allow opening files 
but only databases with a certain name stored in some offlineStoragePath. This 
could be theoretically changed in the C++ part via QtQMLEngine, but thats 
hardly doable if you run your tests using the QUICK_TEST_MAIN() macro.
So any ideas regarding how to best test a db migration?

Best regards

schmittlauch

[1] https://github.com/amarchen/helloworld-pro-sailfish

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to