Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 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 | |
| 15 | LOCAL_PATH := $(call my-dir) |
| 16 | include $(CLEAR_VARS) |
| 17 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 18 | LOCAL_USE_AAPT2 := true |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 19 | LOCAL_MODULE_TAGS := tests |
| 20 | |
Sid Soundararajan | b58c46a | 2016-01-26 15:39:27 -0800 | [diff] [blame] | 21 | LOCAL_JACK_FLAGS := --multi-dex native |
Colin Cross | 254a418 | 2017-01-20 14:46:38 -0800 | [diff] [blame] | 22 | LOCAL_DX_FLAGS := --multi-dex |
Sid Soundararajan | b58c46a | 2016-01-26 15:39:27 -0800 | [diff] [blame] | 23 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 24 | LOCAL_PACKAGE_NAME := SystemUITests |
Anton Hansson | d137c87 | 2018-02-23 12:57:51 +0000 | [diff] [blame] | 25 | LOCAL_PRIVATE_PLATFORM_APIS := true |
Simran Basi | 473a16e | 2017-03-15 14:43:58 -0700 | [diff] [blame] | 26 | LOCAL_COMPATIBILITY_SUITE := device-tests |
Winson | 190fe3bf | 2015-10-20 14:57:24 -0700 | [diff] [blame] | 27 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 28 | LOCAL_STATIC_ANDROID_LIBRARIES := \ |
Jason Monk | ae7ced2 | 2018-08-22 16:56:58 -0400 | [diff] [blame] | 29 | SystemUI-tests |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 30 | |
Jason Monk | 1fc931a | 2017-12-14 13:22:58 -0500 | [diff] [blame] | 31 | LOCAL_MULTILIB := both |
| 32 | |
| 33 | LOCAL_JNI_SHARED_LIBRARIES := \ |
| 34 | libdexmakerjvmtiagent \ |
Beverly | 9028d41 | 2019-12-11 16:33:16 -0500 | [diff] [blame] | 35 | libmultiplejvmtiagentsinterferenceagent \ |
| 36 | libstaticjvmtiagent |
Jason Monk | 1fc931a | 2017-12-14 13:22:58 -0500 | [diff] [blame] | 37 | |
Paul Duffin | b866307 | 2017-12-08 00:02:42 +0000 | [diff] [blame] | 38 | LOCAL_JAVA_LIBRARIES := \ |
| 39 | android.test.runner \ |
| 40 | telephony-common \ |
Paul Duffin | b866307 | 2017-12-08 00:02:42 +0000 | [diff] [blame] | 41 | android.test.base \ |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 42 | |
Hyunyoung Song | 8f9d34c | 2019-08-30 14:47:43 -0700 | [diff] [blame] | 43 | LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 44 | |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 45 | # sign this with platform cert, so this test is allowed to inject key events into |
| 46 | # UI it doesn't own. This is necessary to allow screenshots to be taken |
| 47 | LOCAL_CERTIFICATE := platform |
| 48 | |
Sunny Goyal | eb18d39 | 2020-02-07 16:48:14 -0800 | [diff] [blame] | 49 | LOCAL_FULL_LIBS_MANIFEST_FILES := $(LOCAL_PATH)/AndroidManifest.xml |
| 50 | LOCAL_MANIFEST_FILE := AndroidManifest-base.xml |
| 51 | |
Allen Hair | 8fef05f | 2016-08-29 12:21:02 -0700 | [diff] [blame] | 52 | # Provide jack a list of classes to exclude from code coverage. |
| 53 | # This is needed because the SystemUITests compile SystemUI source directly, rather than using |
| 54 | # LOCAL_INSTRUMENTATION_FOR := SystemUI. |
| 55 | # |
| 56 | # We want to exclude the test classes from code coverage measurements, but they share the same |
| 57 | # package as the rest of SystemUI so they can't be easily filtered by package name. |
| 58 | # |
| 59 | # Generate a comma separated list of patterns based on the test source files under src/ |
| 60 | # SystemUI classes are in ../src/ so they won't be excluded. |
| 61 | # Example: |
| 62 | # Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java |
| 63 | # Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest* |
| 64 | |
| 65 | # Filter all src files under src/ to just java files |
| 66 | local_java_files := $(filter %.java,$(call all-java-files-under, src)) |
| 67 | # Transform java file names into full class names. |
| 68 | # This only works if the class name matches the file name and the directory structure |
| 69 | # matches the package. |
| 70 | local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) |
| 71 | local_comma := , |
| 72 | local_empty := |
| 73 | local_space := $(local_empty) $(local_empty) |
| 74 | # Convert class name list to jacoco exclude list |
| 75 | # This appends a * to all classes and replace the space separators with commas. |
| 76 | jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) |
| 77 | |
Allen Hair | 9aa82fd | 2019-04-01 16:32:00 -0700 | [diff] [blame] | 78 | LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.*,com.android.keyguard.* |
| 79 | LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude) |
Allen Hair | 02fd6094 | 2016-08-25 16:06:26 -0700 | [diff] [blame] | 80 | |
Jason Monk | 4f70b9c | 2016-10-26 15:05:42 -0400 | [diff] [blame] | 81 | ifeq ($(EXCLUDE_SYSTEMUI_TESTS),) |
| 82 | include $(BUILD_PACKAGE) |
| 83 | endif |
Allen Hair | 8fef05f | 2016-08-29 12:21:02 -0700 | [diff] [blame] | 84 | |
| 85 | # Reset variables |
| 86 | local_java_files := |
| 87 | local_classes := |
| 88 | local_comma := |
| 89 | local_space := |
| 90 | jacoco_exclude := |