-
Notifications
You must be signed in to change notification settings - Fork 79
Squish support in Mergin Maps #4292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Withalion
wants to merge
15
commits into
master
Choose a base branch
from
feature/squish-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f5626b7
Add squish support for Android
Withalion 4f9169b
Fix formatting
Withalion 61eddda
Improve StackView support for Squish
Withalion 2d27476
Tidy cmake
Withalion 6cdb2bc
Add iOS support WIP
Withalion 4f9c3cc
Fix build for iOS
Withalion 73acf74
Add ios squish info
Withalion 2354047
Fix cmake formatting
Withalion 4b93cc5
Fix builds for android
Withalion bf27c18
Fix cmake formatting
Withalion 844946e
Create CI check for forbidden StackView
Withalion 7aa8421
Fix regex in code_style check
Withalion b6fbc4b
Refactor squish cmake variable
Withalion 36f40be
Remove unnecessary imports
Withalion 45cac60
Format cmake
Withalion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -630,6 +630,7 @@ Once the project is opened, build it from Xcode. | |
|
|
||
| # 9. Auto Testing <a name="auto-testing"></a> | ||
|
|
||
| ## Mergin API tests | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are unit tests, not only mergin api tests |
||
| You need to add cmake define `-DENABLE_TESTING=TRUE` on your cmake configure line. | ||
| Also, you need to open Passbolt and check for password for user `test_mobileapp` on `app.dev.merginmaps.com`, | ||
| or you need some user with unlimited projects limit. First workspace from list is taken. | ||
|
|
@@ -645,3 +646,45 @@ TEST_API_PASSWORD=<your_password> | |
|
|
||
| Build binary, and you can run tests either with `ctest` or you can run individual tests by adding `--test<TestName>` | ||
| e.g. ` ./MerginMaps --testMerginApi` | ||
|
|
||
| ## Squish tests | ||
| ### Prerequisites | ||
| - Squish for Qt for Android (ARMv8/ARMv7 depending on architecture you build for) | ||
| - Squish for Qt for iOS | ||
| - Squish for Qt (Windows/Mac/Linux), this should also include the Squish IDE | ||
|
|
||
| ### Android & iOS | ||
| After you unpack both (Qt & Qt for Android / iOS) and install Squish IDE, add these cmake arguments | ||
| ```cmake | ||
| -DSQUISH_PATH=/<path>/<to>/<squish-for-android-or-ios>/<directory>/ | ||
| -DCMAKE_FIND_ROOT_PATH=/<path>/<to>/<squish-for-android-or-ios>/<directory>/ | ||
| -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH | ||
| ``` | ||
| This will build the app with squish hook inside. You can verify that squish is working by finding these lines in log after startup: | ||
|
|
||
| ##### Android log | ||
| ```shell | ||
| I/Squish (26459): Setting SQUISH_PREFIX to '/data/data/uk.co.lutraconsulting' | ||
| I/Squish (26459): libMerginMaps_arm64-v8a.so[26459]: Loading Qt Wrapper configuration from ":/squish/etc/qtwrapper.ini" | ||
| I/Squish (26459): libMerginMaps_arm64-v8a.so[26459]: QObject lifetime tracking is disabled | ||
| I/Squish (26459): libMerginMaps_arm64-v8a.so[26459]: Listening on port 7757 for incoming connections | ||
| ``` | ||
|
|
||
| ##### iOS log | ||
| ```shell | ||
| MerginMaps[834]: Loading Qt Wrapper configuration from ":/squish/etc/qtwrapper.ini" | ||
| MerginMaps[834]: QObject lifetime tracking is disabled | ||
| MerginMaps[834]: Listening on port 7757 for incoming connections | ||
| ``` | ||
|
|
||
| ### Squish | ||
| In the squish IDE it's necessary to follow these steps to finish setting it up and start testing the application. | ||
| 1. In Squish IDE choose File, New Test Suite to create a new Test Suite and follow the wizard. When asked for the GUI Toolkit choose Qt. When asked for the Application Under Test choose \<No Application\>. | ||
| 2. [Register attachable AUT](https://doc.qt.io/squish/attaching-to-running-applications.html#register-the-attachable-aut) | ||
| 1. As _Name_ set `MerginMaps`, _Host_ is the IP address of your phone (has to be on the same Wifi) and set _Port_ to `7757` | ||
| 2. You can also use USB cable to connect both devices. However, there is some further setup to do, first you need to forward the device port to your PC with: | ||
| ```shell | ||
| $ adb forward tcp:portnumber tcp:portnumber | ||
| ``` | ||
| After that the setup is the same as in point 1, just _Host_ will become `localhost`. | ||
| 3. The test script should start with `attachToApplication("MerginMaps")` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| import QtQuick | ||
| import QtQuick.Controls | ||
|
|
||
| // StackView wrapper, which improves Squish support. Should be used instead of pure QML StackView. | ||
|
|
||
| StackView { | ||
| id: root | ||
|
|
||
| visible: !empty | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ Item { | |
| } | ||
| } | ||
|
|
||
| StackView { | ||
| MMStackView { | ||
| id: pagesStackView | ||
|
|
||
| anchors.fill: parent | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ Item { | |
| } | ||
|
|
||
|
|
||
| StackView { | ||
| MMStackView { | ||
| id: stackview | ||
|
|
||
| width: ApplicationWindow.window?.width ?? 0 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.