Retry test-runner tests move.
This time change the frameworks makefile so it only includes test-runner/src in the public API.
This commit is contained in:
@@ -276,7 +276,7 @@ packages_to_document := \
|
||||
# Search through the base framework dirs for these packages.
|
||||
# The result will be relative to frameworks/base.
|
||||
fwbase_dirs_to_document := \
|
||||
test-runner \
|
||||
test-runner/src \
|
||||
$(patsubst $(LOCAL_PATH)/%,%, \
|
||||
$(wildcard \
|
||||
$(foreach dir, $(FRAMEWORKS_BASE_JAVA_SRC_DIRS), \
|
||||
|
||||
@@ -18,10 +18,13 @@ LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := $(call all-subdir-java-files)
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := core framework
|
||||
|
||||
LOCAL_MODULE:= android.test.runner
|
||||
|
||||
include $(BUILD_JAVA_LIBRARY)
|
||||
|
||||
# additionally, build unit tests in a separate .apk
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
||||
|
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 964 B |
|
Before Width: | Height: | Size: 883 B After Width: | Height: | Size: 883 B |
29
test-runner/tests/Android.mk
Normal file
29
test-runner/tests/Android.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
# Copyright 2010, 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.
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# We only want this apk build for tests.
|
||||
LOCAL_MODULE_TAGS := tests
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := android.test.runner
|
||||
|
||||
# Include all test java files.
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_PACKAGE_NAME := FrameworkTestRunnerTests
|
||||
|
||||
include $(BUILD_PACKAGE)
|
||||
|
||||
43
test-runner/tests/AndroidManifest.xml
Normal file
43
test-runner/tests/AndroidManifest.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 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.frameworks.testrunner.tests">
|
||||
|
||||
<application>
|
||||
<uses-library android:name="android.test.runner" />
|
||||
<activity android:name="android.test.StubTestBrowserActivity"
|
||||
android:label="Stubbed Test Browser">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.FOR_TESTS_ONLY"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="android.test.TestBrowserTests"
|
||||
android:label="Test Browser Tests">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.UNIT_TEST"/>
|
||||
</intent-filter>
|
||||
</activity>`
|
||||
</application>
|
||||
|
||||
<instrumentation
|
||||
android:name="android.test.InstrumentationTestRunner"
|
||||
android:targetPackage="com.android.frameworks.testrunner.tests"
|
||||
android:label="Framework testrunner tests" />
|
||||
</manifest>
|
||||
@@ -215,19 +215,24 @@ public class TestBrowserActivityTest extends InstrumentationTestCase {
|
||||
}
|
||||
|
||||
private TestBrowserActivity createActivity() throws RemoteException {
|
||||
return launchActivity("android.test", StubTestBrowserActivity.class, null);
|
||||
return launchActivity(getAndroidPackageName(), StubTestBrowserActivity.class, null);
|
||||
}
|
||||
|
||||
private Intent createIntent(TestSuite testSuite) {
|
||||
Intent intent = new Intent(Intent.ACTION_RUN);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
String className = StubTestBrowserActivity.class.getName();
|
||||
String packageName = className.substring(0, className.lastIndexOf("."));
|
||||
String packageName = getAndroidPackageName();
|
||||
intent.setClassName(packageName, className);
|
||||
intent.setData(Uri.parse(testSuite.getName()));
|
||||
return intent;
|
||||
}
|
||||
|
||||
private String getAndroidPackageName() {
|
||||
String packageName = getInstrumentation().getTargetContext().getPackageName();
|
||||
return packageName;
|
||||
}
|
||||
|
||||
private TestBrowserActivity launchTestBrowserActivity(TestSuite testSuite)
|
||||
throws RemoteException {
|
||||
getInstrumentation().setInTouchMode(false);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user