Last active
June 23, 2016 17:09
-
-
Save venkata-kari/e538bb03442574ca32f1dbfb4d75649c to your computer and use it in GitHub Desktop.
module-flavor1-androidTest-only
This file contains 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
<?xml version="1.0" encoding="utf-8"?><!-- | |
Copyright 2015 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. | |
--> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.android.testing.blueprint.test"> | |
<!-- Specify runner and target application package --> | |
<instrumentation | |
android:name="android.support.test.runner.AndroidJUnitRunner" | |
android:targetPackage="com.example.android.testing.blueprint.flavor1" /> | |
<application> | |
<uses-library android:name="android.test.runner" /> | |
</application> | |
</manifest> |
This file contains 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
//module-flavor1-androidTest-only build.gradle | |
apply plugin: 'com.android.test' // A plugin used for test-only-modules | |
android { | |
compileSdkVersion rootProject.ext.compileSdkVersion | |
buildToolsVersion rootProject.ext.buildToolsVersion | |
defaultConfig { | |
minSdkVersion rootProject.ext.minSdkVersion | |
targetSdkVersion rootProject.ext.targetSdkVersion | |
// The package name of the test app | |
testApplicationId 'com.example.android.testing.blueprint.test' | |
// The Instrumentation test runner used to run tests. | |
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' | |
} | |
// Set the target app project. The module specified here should contain the production code | |
// test should run against. | |
targetProjectPath ':app' | |
targetVariant 'flavor1Debug' | |
} | |
dependencies { | |
// Android Testing Support Library's runner and rules and hamcrest matchers | |
compile('com.android.support.test.espresso:espresso-core:2.2') { | |
exclude group: 'com.android.support', module: 'support-annotations' | |
exclude group: 'com.google.guava', module: 'guava' | |
exclude group: 'junit', module: 'junit' | |
} | |
compile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion | |
compile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion | |
compile 'org.hamcrest:hamcrest-core:' + rootProject.ext.hamcrestVersion | |
} |
This file contains 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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:2.1.2' | |
// NOTE: Do not place your application dependencies here; they belong | |
// in the individual module build.gradle files | |
} | |
} | |
allprojects { | |
repositories { | |
jcenter() | |
} | |
} | |
ext { | |
minSdkVersion = 10 | |
targetSdkVersion = 23 | |
compileSdkVersion = 23 | |
buildToolsVersion = "24" | |
supportLibVersion = "23.1.1" | |
junitVersion = "4.12" | |
mockitoVersion = "1.10.19" | |
hamcrestVersion = "1.3" | |
runnerVersion = "0.5" | |
rulesVersion = "0.5" | |
espressoVersion = "2.2.2" | |
uiautomatorVersion = "2.1.2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To run the tests from module-flavor1-androidTest-only, created a new configuration as shown below.