blob: b32bf99ad53d7cc7ad31f4f81c43f0341853b442 [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
Colin Cross254a4182017-01-20 14:46:38 -080022LOCAL_DX_FLAGS := --multi-dex
Sid Soundararajanb58c46a2016-01-26 15:39:27 -080023
Adam Lesinski38e89662016-06-24 15:00:11 -070024LOCAL_PACKAGE_NAME := SystemUITests
Anton Hanssond137c872018-02-23 12:57:51 +000025LOCAL_PRIVATE_PLATFORM_APIS := true
Simran Basi473a16e2017-03-15 14:43:58 -070026LOCAL_COMPATIBILITY_SUITE := device-tests
Winson190fe3bf2015-10-20 14:57:24 -070027
Adam Lesinski38e89662016-06-24 15:00:11 -070028LOCAL_STATIC_ANDROID_LIBRARIES := \
Jason Monkae7ced22018-08-22 16:56:58 -040029 SystemUI-tests
Brett Chabotcaf30a12011-07-28 19:33:22 -070030
Jason Monk1fc931a2017-12-14 13:22:58 -050031LOCAL_MULTILIB := both
32
33LOCAL_JNI_SHARED_LIBRARIES := \
34 libdexmakerjvmtiagent \
35 libmultiplejvmtiagentsinterferenceagent
36
Paul Duffinb8663072017-12-08 00:02:42 +000037LOCAL_JAVA_LIBRARIES := \
38 android.test.runner \
39 telephony-common \
Paul Duffinb8663072017-12-08 00:02:42 +000040 android.test.base \
Ying Zheng4fd6b782018-09-11 12:55:04 -070041 android.car \
Ying Zheng149f9382018-11-02 15:46:07 -070042 android.car.userlib
Adam Lesinski38e89662016-06-24 15:00:11 -070043
Jason Monk23f85ec2017-01-31 14:29:32 -050044LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui:com.android.keyguard
Adam Lesinski38e89662016-06-24 15:00:11 -070045
Brett Chabotcaf30a12011-07-28 19:33:22 -070046# sign this with platform cert, so this test is allowed to inject key events into
47# UI it doesn't own. This is necessary to allow screenshots to be taken
48LOCAL_CERTIFICATE := platform
49
Allen Hair8fef05f2016-08-29 12:21:02 -070050# Provide jack a list of classes to exclude from code coverage.
51# This is needed because the SystemUITests compile SystemUI source directly, rather than using
52# LOCAL_INSTRUMENTATION_FOR := SystemUI.
53#
54# We want to exclude the test classes from code coverage measurements, but they share the same
55# package as the rest of SystemUI so they can't be easily filtered by package name.
56#
57# Generate a comma separated list of patterns based on the test source files under src/
58# SystemUI classes are in ../src/ so they won't be excluded.
59# Example:
60# Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java
61# Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest*
62
63# Filter all src files under src/ to just java files
64local_java_files := $(filter %.java,$(call all-java-files-under, src))
65# Transform java file names into full class names.
66# This only works if the class name matches the file name and the directory structure
67# matches the package.
68local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
69local_comma := ,
70local_empty :=
71local_space := $(local_empty) $(local_empty)
72# Convert class name list to jacoco exclude list
73# This appends a * to all classes and replace the space separators with commas.
74jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
75
Allen Hair02fd60942016-08-25 16:06:26 -070076LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.*
Allen Hair8fef05f2016-08-29 12:21:02 -070077LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := com.android.systemui.tests.*,$(jacoco_exclude)
Allen Hair02fd60942016-08-25 16:06:26 -070078
Jason Monk4f70b9c2016-10-26 15:05:42 -040079ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
80 include $(BUILD_PACKAGE)
81endif
Allen Hair8fef05f2016-08-29 12:21:02 -070082
83# Reset variables
84local_java_files :=
85local_classes :=
86local_comma :=
87local_space :=
88jacoco_exclude :=