summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Franz <bfranz@google.com>2015-06-10 18:21:59 +0100
committerBenjamin Franz <bfranz@google.com>2015-06-24 20:07:20 +0100
commit51bc1eb1d6716d8cab2938983981883d6ea07641 (patch)
tree6259ec2229ed1ff37162547a80ab064e4dbbead2 /tests
parent25062c52b85e4c8887b817f9453198d6995c3ef8 (diff)
downloadandroid_packages_apps_ManagedProvisioning-51bc1eb1d6716d8cab2938983981883d6ea07641.tar.gz
android_packages_apps_ManagedProvisioning-51bc1eb1d6716d8cab2938983981883d6ea07641.tar.bz2
android_packages_apps_ManagedProvisioning-51bc1eb1d6716d8cab2938983981883d6ea07641.zip
Preparation for unit tests in managed provisioning
Bug: 21632069 Change-Id: Ifd8e13f2f4755bd463f2c653fa52735b2d072e7c
Diffstat (limited to 'tests')
-rw-r--r--tests/Android.mk17
-rw-r--r--tests/AndroidManifest.xml28
-rw-r--r--tests/README17
3 files changed, 62 insertions, 0 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
new file mode 100644
index 00000000..a05a12d8
--- /dev/null
+++ b/tests/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := ManagedProvisioningTests
+LOCAL_CERTIFICATE := platform
+
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test mockito-target
+
+LOCAL_INSTRUMENTATION_FOR := ManagedProvisioning
+
+include $(BUILD_PACKAGE)
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
new file mode 100644
index 00000000..43cec3dd
--- /dev/null
+++ b/tests/AndroidManifest.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.android.managedprovisioning.tests">
+
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <instrumentation android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.android.managedprovisioning"
+ android:label="Tests for ManagedProvisioning">
+ </instrumentation>
+</manifest>
diff --git a/tests/README b/tests/README
new file mode 100644
index 00000000..da83d8ad
--- /dev/null
+++ b/tests/README
@@ -0,0 +1,17 @@
+To build the tests you can use the following command at the root of your android source tree
+$ make ManagedProvisioningTests
+
+The test apk then needs to be installed onto your test device via for example
+$ adb install -r out/target/product/shamu/data/app/ManagedProvisioningTests/ManagedProvisioningTests.apk
+
+To run all tests:
+$ adb shell am instrument -w com.android.managedprovisioning.tests/android.test.InstrumentationTestRunner
+
+To run all tests in a specific class:
+$ adb shell am instrument -w -e class com.android.managedprovisioning.<class> com.android.managedprovisioning.tests/android.test.InstrumentationTestRunner
+
+To run a specific test:
+$ adb shell am instrument -w -e class com.android.managedprovisioning.<class>#<test> com.android.managedprovisioning.tests/android.test.InstrumentationTestRunner
+
+More general information can be found at
+http://developer.android.com/reference/android/test/InstrumentationTestRunner.html