1# Copyright (C) 2015 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) 16 17# Make test APK 18# ============================================================ 19include $(CLEAR_VARS) 20 21LOCAL_MODULE_TAGS := tests 22 23LOCAL_SRC_FILES := $(call all-subdir-java-files) 24 25# Provide jack a list of classes to exclude form code coverage 26# This list is generated from the java source files in this module 27# The list is a comma separated list of class names with * matching zero or more characters. 28# Example: 29# Input files: src/com/android/server/wifi/Test.java src/com/android/server/wifi/AnotherTest.java 30# Generated exclude list: com.android.server.wifi.Test*,com.android.server.wifi.AnotherTest* 31 32# Filter all src files to just java files 33local_java_files := $(filter %.java,$(LOCAL_SRC_FILES)) 34# Transform java file names into full class names. 35# This only works if the class name matches the file name and the directory structure 36# matches the package. 37local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) 38# Utility variables to allow replacing a space with a comma 39comma:= , 40empty:= 41space:= $(empty) $(empty) 42# Convert class name list to jacoco exclude list 43# This appends a * to all classes and replace the space separators with commas. 44# These patterns will match all classes in this module and their inner classes. 45jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) 46 47jacoco_include := com.android.server.wifi.* 48 49LOCAL_JACK_COVERAGE_INCLUDE_FILTER := $(jacoco_include) 50LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude) 51 52LOCAL_DX_FLAGS := --multi-dex 53LOCAL_JACK_FLAGS := --multi-dex native 54 55# wifi-service and services must be included here so that the latest changes 56# will be used when tests. Otherwise the tests would run against the installed 57# system. 58# TODO figure out if this is the correct thing to do, this seems to not be right 59# since neither is declared a static java library. 60LOCAL_STATIC_JAVA_LIBRARIES := \ 61 android-support-test \ 62 mockito-target-minus-junit4 \ 63 frameworks-base-testutils \ 64 services \ 65 wifi-service \ 66 67LOCAL_JAVA_LIBRARIES := \ 68 android.test.runner \ 69 android.hidl.manager-V1.0-java \ 70 android.test.base \ 71 android.test.mock \ 72 conscrypt 73 74# These must be explicitly included because they are not normally accessible 75# from apps. 76LOCAL_JNI_SHARED_LIBRARIES := \ 77 libcrypto \ 78 libwifi-service \ 79 libEGL \ 80 libGLESv2 \ 81 libaudioutils \ 82 libbacktrace \ 83 libbase \ 84 libbinder \ 85 libc++ \ 86 libcamera_client \ 87 libcamera_metadata \ 88 libcutils \ 89 libexpat \ 90 libgui \ 91 libhardware \ 92 libicui18n \ 93 libicuuc \ 94 liblzma \ 95 libmedia \ 96 libnativehelper \ 97 libnbaio \ 98 libnetutils \ 99 libnl \ 100 libpowermanager \ 101 libsonivox \ 102 libspeexresampler \ 103 libstagefright_foundation \ 104 libstdc++ \ 105 libsync \ 106 libwifi-system \ 107 libui \ 108 libunwind \ 109 libunwindstack \ 110 libutils \ 111 libvndksupport \ 112 113ifdef WPA_SUPPLICANT_VERSION 114LOCAL_JNI_SHARED_LIBRARIES += libwpa_client 115endif 116 117LOCAL_PACKAGE_NAME := FrameworksWifiTests 118LOCAL_PRIVATE_PLATFORM_APIS := true 119 120LOCAL_COMPATIBILITY_SUITE := device-tests 121 122include $(BUILD_PACKAGE) 123