diff options
author | Tobrun <tobrun@mapbox.com> | 2016-01-06 15:15:19 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2016-01-12 12:40:58 +0100 |
commit | 3e4c1bd5341ec46aedd195c2e2b575e030b30e0a (patch) | |
tree | 5f0121ae9d9cd337198656582ebf58b217259844 /platform/android/tests/docs/UNIT_TESTS.md | |
parent | 71edb38cf10bde4180e5e4c65ea229c80ee680eb (diff) | |
download | qtlocation-mapboxgl-3e4c1bd5341ec46aedd195c2e2b575e030b30e0a.tar.gz |
[android] #3447 - initial commit to verify current progress
Diffstat (limited to 'platform/android/tests/docs/UNIT_TESTS.md')
-rw-r--r-- | platform/android/tests/docs/UNIT_TESTS.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/platform/android/tests/docs/UNIT_TESTS.md b/platform/android/tests/docs/UNIT_TESTS.md new file mode 100644 index 0000000000..ef89f23ced --- /dev/null +++ b/platform/android/tests/docs/UNIT_TESTS.md @@ -0,0 +1,32 @@ +# Unit tests +Our Unit tests are based on JUnit and are located under `/src/test/java/`. +We are using plain JUnit to test classes that aren't calling the Android API, +or are using Android's JUnit extensions to stub/mock Android components. + +## Running Unit tests locally +To run Unit tests locally you switch to the Unit Tests build variant, then right click the corresponding test class or method and select "Run ...". + +You can also have a run configuration: +* Click on Run -> Edit Configurations... +* Click on "Junit Tests" +* Give a name to the configuration, e.g. `JUnit tests` +* As "Test Kind", choose "All in directory" +* As folder, choose the following folder: `mapbox-gl-native/platforms/android/java/MapboxGLAndroidSDKTestApp/src/test/java` +* Click OK to save the new configuration + +You can also run the tests from the command line with: + +``` +$ ./gradlew test --continue -p MapboxGLAndroidSDKTestApp +``` + +## Running Unit tests on CI +The Unit tests are executed as part of the build process on our CI and are +automatically run for each new commit pushed to this repo. If a Unit tests +fails, this will fail and stop the build. + +You can find this gradle command in our [buildscript](https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/bitrise.yml#L48): + +``` +$ ./gradlew testReleaseUnitTest --continue +``` |