[Android] Add android test orchestrator

Habib Kazemi git at videolan.org
Thu Aug 9 08:50:22 CEST 2018


vlc-android | branch: master | Habib Kazemi <kazemihabib1996 at gmail.com> | Mon Aug  6 16:45:48 2018 +0430| [2c44b57d8fba80256d3e8ed9e1406bc2bc03642b] | committer: Geoffrey Métais

Add android test orchestrator

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

> https://code.videolan.org/videolan/vlc-android/commit/2c44b57d8fba80256d3e8ed9e1406bc2bc03642b
---

 build.gradle             |  1 +
 vlc-android/build.gradle | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/build.gradle b/build.gradle
index aeb26aef7..e189389f0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,6 +31,7 @@ ext {
     compileSdkVersion = 26
     junitVersion = '4.12'
     espressoVersion = '3.0.1'
+    supportTest = '1.0.2'
     minSdkVersion = 17
     targetSdkVersion = 26
     versionName = '3.0.13'
diff --git a/vlc-android/build.gradle b/vlc-android/build.gradle
index e160925a8..b333dc856 100644
--- a/vlc-android/build.gradle
+++ b/vlc-android/build.gradle
@@ -47,6 +47,10 @@ android {
         resValue "string", "build_vlc_revision", vlcRevision()
 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        // The following argument makes the Android Test Orchestrator run its
+        // "pm clear" command after each test invocation. This command ensures
+        // that the app's state is completely cleared between tests.
+        testInstrumentationRunnerArguments clearPackageData: 'true'
 
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
@@ -68,6 +72,10 @@ android {
         }
     }
 
+    testOptions {
+        execution 'ANDROID_TEST_ORCHESTRATOR'
+    }
+
     signingConfigs {
         release {
             /*
@@ -225,6 +233,8 @@ dependencies {
     androidTestImplementation "android.arch.persistence.room:testing:$rootProject.ext.roomVersion"
     testImplementation "android.arch.core:core-testing:$rootProject.ext.archVersion"
     androidTestImplementation "android.arch.core:core-testing:$rootProject.ext.archVersion"
+    androidTestImplementation "com.android.support.test:runner:$rootProject.ext.supportTest"
+    androidTestUtil "com.android.support.test:orchestrator:$rootProject.ext.supportTest"
 
 }
 



More information about the Android mailing list