<html><head></head><body>+1, I've never figured it out either. I asked a similar question a long time ago but never received an answer.<br><br><div class="gmail_quote">On July 27, 2017 1:08:26 AM GMT+02:00, Trolli Schmittlauch <t.schmittlauch+ml@orlives.de> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Hi,<br /><br />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.<br />Are there some other devs doing UnitTests on their QML apps? Are you using QtTest, too?<br /><br />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.<br />So which project structure and approach for running tests are you using?<br /><br />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.<br />So any ideas regarding how to best test a db migration?<br /><br />Best regards<br /><br />schmittlauch<br /><br />[1] <a href="https://github.com/amarchen/helloworld-pro-sailfish">https://github.com/amarchen/helloworld-pro-sailfish</a></pre></blockquote></div><br>
-- <br>
Sent from my mobile. Please excuse my brevity.</body></html>