1# Copyright (C) 2011 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15LOCAL_PATH := $(call my-dir) 16include $(CLEAR_VARS) 17 18LOCAL_USE_AAPT2 := true 19LOCAL_MODULE_TAGS := tests 20 21LOCAL_JACK_FLAGS := --multi-dex native 22LOCAL_DX_FLAGS := --multi-dex 23 24LOCAL_PACKAGE_NAME := SystemUITests 25LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 26LOCAL_LICENSE_CONDITIONS := notice 27LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE 28LOCAL_PRIVATE_PLATFORM_APIS := true 29LOCAL_COMPATIBILITY_SUITE := device-tests 30 31LOCAL_STATIC_ANDROID_LIBRARIES := \ 32 SystemUI-tests 33 34LOCAL_MULTILIB := both 35 36LOCAL_JNI_SHARED_LIBRARIES := \ 37 libdexmakerjvmtiagent \ 38 libmultiplejvmtiagentsinterferenceagent \ 39 libstaticjvmtiagent 40 41LOCAL_JAVA_LIBRARIES := \ 42 android.test.runner \ 43 telephony-common \ 44 android.test.base \ 45 46LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui 47 48# sign this with platform cert, so this test is allowed to inject key events into 49# UI it doesn't own. This is necessary to allow screenshots to be taken 50LOCAL_CERTIFICATE := platform 51 52LOCAL_FULL_LIBS_MANIFEST_FILES := $(LOCAL_PATH)/AndroidManifest.xml 53LOCAL_MANIFEST_FILE := AndroidManifest-base.xml 54 55# Provide jack a list of classes to exclude from code coverage. 56# This is needed because the SystemUITests compile SystemUI source directly, rather than using 57# LOCAL_INSTRUMENTATION_FOR := SystemUI. 58# 59# We want to exclude the test classes from code coverage measurements, but they share the same 60# package as the rest of SystemUI so they can't be easily filtered by package name. 61# 62# Generate a comma separated list of patterns based on the test source files under src/ 63# SystemUI classes are in ../src/ so they won't be excluded. 64# Example: 65# Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java 66# Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest* 67 68# Filter all src files under src/ to just java files 69local_java_files := $(filter %.java,$(call all-java-files-under, src)) 70# Transform java file names into full class names. 71# This only works if the class name matches the file name and the directory structure 72# matches the package. 73local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) 74local_comma := , 75local_empty := 76local_space := $(local_empty) $(local_empty) 77# Convert class name list to jacoco exclude list 78# This appends a * to all classes and replace the space separators with commas. 79jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) 80 81LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.*,com.android.keyguard.* 82LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude) 83 84ifeq ($(EXCLUDE_SYSTEMUI_TESTS),) 85 include $(BUILD_PACKAGE) 86endif 87 88# Reset variables 89local_java_files := 90local_classes := 91local_comma := 92local_space := 93jacoco_exclude := 94