Merge "Change build targets for settings tests"
This commit is contained in:
committed by
Android (Google) Code Review
commit
090e37b5f2
@@ -1,19 +1,5 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# We only want this apk build for tests.
|
||||
LOCAL_MODULE_TAGS := tests
|
||||
LOCAL_CERTIFICATE := platform
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := android.test.runner bouncycastle
|
||||
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := android-support-test mockito-target
|
||||
|
||||
# Include all test java files.
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_PACKAGE_NAME := SettingsTests
|
||||
|
||||
LOCAL_INSTRUMENTATION_FOR := Settings
|
||||
|
||||
include $(BUILD_PACKAGE)
|
||||
# Include all makefiles in subdirectories
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
17
tests/README
17
tests/README
@@ -1,17 +0,0 @@
|
||||
To build the tests you can use the following command at the root of your android source tree
|
||||
$ make SettingsTests
|
||||
|
||||
The test apk then needs to be installed onto your test device via for example
|
||||
$ adb install -r out/target/product/shamu/data/app/SettingsTests/SettingsTests.apk
|
||||
|
||||
To run all tests:
|
||||
$ adb shell am instrument -w com.android.settings.tests/android.support.test.runner.AndroidJUnitRunner
|
||||
|
||||
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.settings.<class> com.android.settings.tests/android.support.test.runner.AndroidJUnitRunner
|
||||
|
||||
More general information can be found at
|
||||
http://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html
|
17
tests/app/Android.mk
Normal file
17
tests/app/Android.mk
Normal file
@@ -0,0 +1,17 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# We only want this apk build for tests.
|
||||
LOCAL_MODULE_TAGS := tests
|
||||
LOCAL_CERTIFICATE := platform
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := android.test.runner bouncycastle
|
||||
|
||||
# Include all test java files.
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_PACKAGE_NAME := SettingsTests
|
||||
|
||||
LOCAL_INSTRUMENTATION_FOR := Settings
|
||||
|
||||
include $(BUILD_PACKAGE)
|
@@ -51,9 +51,14 @@
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
<instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
|
||||
<instrumentation android:name="android.test.InstrumentationTestRunner"
|
||||
android:targetPackage="com.android.settings"
|
||||
android:label="Settings Test Cases">
|
||||
android:label="Settings App Tests">
|
||||
</instrumentation>
|
||||
|
||||
<instrumentation android:name="SettingsLaunchPerformance"
|
||||
android:targetPackage="com.android.settings"
|
||||
android:label="Settings Launch Performance">
|
||||
</instrumentation>
|
||||
|
||||
</manifest>
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
19
tests/unit/Android.mk
Normal file
19
tests/unit/Android.mk
Normal file
@@ -0,0 +1,19 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# We only want this apk build for tests.
|
||||
LOCAL_MODULE_TAGS := tests
|
||||
LOCAL_CERTIFICATE := platform
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := android.test.runner
|
||||
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := android-support-test mockito-target
|
||||
|
||||
# Include all test java files.
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_PACKAGE_NAME := SettingsUnitTests
|
||||
|
||||
LOCAL_INSTRUMENTATION_FOR := Settings
|
||||
|
||||
include $(BUILD_PACKAGE)
|
29
tests/unit/AndroidManifest.xml
Normal file
29
tests/unit/AndroidManifest.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 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.settings.tests.unit">
|
||||
|
||||
<application>
|
||||
<uses-library android:name="android.test.runner" />
|
||||
</application>
|
||||
|
||||
<instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
|
||||
android:targetPackage="com.android.settings"
|
||||
android:label="Settings Test Cases">
|
||||
</instrumentation>
|
||||
|
||||
</manifest>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user