Move notification tests into separate APK.

This will allow us to hook into a presubmit step without
bringing in the other tests.

Compile notification source directly into test APK, for
faster development.

Test: runtest --path
frameworks/base/services/tests/notification/
Change-Id: I04dbcec892cbd375ba1334f59e6b58bcafe80151
This commit is contained in:
Geoffrey Pitsch
2016-11-01 13:38:22 -04:00
parent c990515546
commit b879cc614f
9 changed files with 87 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
#########################################################################
# Build FrameworksNotificationTests package
#########################################################################
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
# Include test java files and source from notifications package.
LOCAL_SRC_FILES := $(call all-java-files-under, src) \
$(call all-java-files-under, ../../core/java/com/android/server/notification)
LOCAL_STATIC_JAVA_LIBRARIES := \
frameworks-base-testutils \
services.accessibility \
services.core \
services.devicepolicy \
services.net \
services.retaildemo \
services.usage \
guava \
android-support-test \
mockito-target-minus-junit4 \
platform-test-annotations
LOCAL_JAVA_LIBRARIES := android.test.runner
LOCAL_PACKAGE_NAME := FrameworksNotificationTests
LOCAL_CERTIFICATE := platform
# These are not normally accessible from apps so they must be explicitly included.
LOCAL_JNI_SHARED_LIBRARIES := libservicestestsjni \
libbacktrace \
libbase \
libbinder \
libc++ \
libcutils \
liblog \
liblzma \
libnativehelper \
libnetdaidl \
libui \
libunwind \
libutils
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
# Code coverage puts us over the dex limit, so enable multi-dex for coverage-enabled builds
ifeq (true,$(EMMA_INSTRUMENT))
LOCAL_JACK_FLAGS := --multi-dex native
endif # EMMA_INSTRUMENT_STATIC
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,31 @@
<?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.frameworks.tests.notification">
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.MANAGE_USERS" />
<application>
<uses-library android:name="android.test.runner" />
</application>
<instrumentation
android:name="android.support.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.frameworks.tests.notification"
android:label="Notification Tests" />
</manifest>