From 51bc1eb1d6716d8cab2938983981883d6ea07641 Mon Sep 17 00:00:00 2001 From: Benjamin Franz Date: Wed, 10 Jun 2015 18:21:59 +0100 Subject: Preparation for unit tests in managed provisioning Bug: 21632069 Change-Id: Ifd8e13f2f4755bd463f2c653fa52735b2d072e7c --- tests/Android.mk | 17 +++++++++++++++++ tests/AndroidManifest.xml | 28 ++++++++++++++++++++++++++++ tests/README | 17 +++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 tests/Android.mk create mode 100644 tests/AndroidManifest.xml create mode 100644 tests/README (limited to 'tests') 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 @@ + + + + + + + + + + + + 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. com.android.managedprovisioning.tests/android.test.InstrumentationTestRunner + +To run a specific test: +$ adb shell am instrument -w -e class com.android.managedprovisioning.# com.android.managedprovisioning.tests/android.test.InstrumentationTestRunner + +More general information can be found at +http://developer.android.com/reference/android/test/InstrumentationTestRunner.html -- cgit v1.2.3