blob: ecf174ff4b0b67718ef536f458e5ad1dd6a1b3bb [file] [log] [blame]
Brett Chabotcaf30a12011-07-28 19:33:22 -07001# 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
Adam Lesinski38e89662016-06-24 15:00:11 -070018LOCAL_USE_AAPT2 := true
Brett Chabotcaf30a12011-07-28 19:33:22 -070019LOCAL_MODULE_TAGS := tests
20
Sid Soundararajanb58c46a2016-01-26 15:39:27 -080021LOCAL_JACK_FLAGS := --multi-dex native
22
Blazej Magnowski72323322015-07-24 11:49:40 -070023LOCAL_PROTOC_OPTIMIZE_TYPE := nano
24LOCAL_PROTOC_FLAGS := -I$(LOCAL_PATH)/..
25LOCAL_PROTO_JAVA_OUTPUT_PARAMS := optional_field_style=accessors
26
Adam Lesinski38e89662016-06-24 15:00:11 -070027LOCAL_PACKAGE_NAME := SystemUITests
Winson190fe3bf2015-10-20 14:57:24 -070028
Jason Monk29f7a7b2014-11-17 14:40:56 -050029LOCAL_SRC_FILES := $(call all-java-files-under, src) \
Winson190fe3bf2015-10-20 14:57:24 -070030 $(call all-Iaidl-files-under, src) \
Adrian Roos4cc2a582016-02-25 09:28:13 -080031 $(call all-java-files-under, ../src)
Jason Monk29f7a7b2014-11-17 14:40:56 -050032
33LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
34 frameworks/base/packages/SystemUI/res \
Brett Chabotcaf30a12011-07-28 19:33:22 -070035
Adam Lesinski38e89662016-06-24 15:00:11 -070036LOCAL_STATIC_ANDROID_LIBRARIES := \
Jason Monk86bc3312016-08-16 13:17:56 -040037 SystemUIPluginLib \
Winsonc29ff002015-11-20 16:00:45 -080038 Keyguard \
Jason Monk87ccd552015-12-11 21:39:54 -050039 android-support-v7-recyclerview \
40 android-support-v7-preference \
41 android-support-v7-appcompat \
Sid Soundararajanb58c46a2016-01-26 15:39:27 -080042 android-support-v14-preference \
Adam Lesinski38e89662016-06-24 15:00:11 -070043 android-support-v17-leanback
44
45LOCAL_STATIC_JAVA_LIBRARIES := \
Geoffrey Pitsch2c403db2016-08-26 09:09:39 -040046 android-support-test \
Geoffrey Pitsch33c62362016-08-31 12:47:29 -040047 mockito-target-minus-junit4 \
Jorim Jaggid0565172016-09-15 16:31:14 -070048 SystemUI-proto \
49 SystemUI-tags
Brett Chabotcaf30a12011-07-28 19:33:22 -070050
Adam Lesinski38e89662016-06-24 15:00:11 -070051LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.car
52
53LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui
54
Brett Chabotcaf30a12011-07-28 19:33:22 -070055# sign this with platform cert, so this test is allowed to inject key events into
56# UI it doesn't own. This is necessary to allow screenshots to be taken
57LOCAL_CERTIFICATE := platform
58
Allen Hair8fef05f2016-08-29 12:21:02 -070059# Provide jack a list of classes to exclude from code coverage.
60# This is needed because the SystemUITests compile SystemUI source directly, rather than using
61# LOCAL_INSTRUMENTATION_FOR := SystemUI.
62#
63# We want to exclude the test classes from code coverage measurements, but they share the same
64# package as the rest of SystemUI so they can't be easily filtered by package name.
65#
66# Generate a comma separated list of patterns based on the test source files under src/
67# SystemUI classes are in ../src/ so they won't be excluded.
68# Example:
69# Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java
70# Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest*
71
72# Filter all src files under src/ to just java files
73local_java_files := $(filter %.java,$(call all-java-files-under, src))
74# Transform java file names into full class names.
75# This only works if the class name matches the file name and the directory structure
76# matches the package.
77local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
78local_comma := ,
79local_empty :=
80local_space := $(local_empty) $(local_empty)
81# Convert class name list to jacoco exclude list
82# This appends a * to all classes and replace the space separators with commas.
83jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
84
Allen Hair02fd60942016-08-25 16:06:26 -070085LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.*
Allen Hair8fef05f2016-08-29 12:21:02 -070086LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := com.android.systemui.tests.*,$(jacoco_exclude)
Allen Hair02fd60942016-08-25 16:06:26 -070087
Jason Monk2ba4ce62015-01-13 10:08:23 -050088include frameworks/base/packages/SettingsLib/common.mk
89
Jason Monk4f70b9c2016-10-26 15:05:42 -040090ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
91 include $(BUILD_PACKAGE)
92endif
Allen Hair8fef05f2016-08-29 12:21:02 -070093
94# Reset variables
95local_java_files :=
96local_classes :=
97local_comma :=
98local_space :=
99jacoco_exclude :=