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 15 LOCAL_PATH:= $(call my-dir) 16 17 # Make test APK 18 # ============================================================ 19 include $(CLEAR_VARS) 20 21 LOCAL_MODULE_TAGS := tests 22 23 LOCAL_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 33 local_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. 37 local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) 38 # Convert class name list to jacoco exclude list 39 # This appends a * to all classes and replace the space separators with commas. 40 # These patterns will match all classes in this module and their inner classes. 41 jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) 42 43 jacoco_include := com.android.server.wifi.* 44 45 LOCAL_JACK_COVERAGE_INCLUDE_FILTER := $(jacoco_include) 46 LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude) 47 48 LOCAL_DX_FLAGS := --multi-dex 49 LOCAL_JACK_FLAGS := --multi-dex native 50 51 # wifi-service and services must be included here so that the latest changes 52 # will be used when tests. Otherwise the tests would run against the installed 53 # system. 54 # TODO figure out if this is the correct thing to do, this seems to not be right 55 # since neither is declared a static java library. 56 LOCAL_STATIC_JAVA_LIBRARIES := \ 57 androidx.test.rules hamcrest-library \ 58 mockito-target-extended-minus-junit4 \ 59 frameworks-base-testutils \ 60 services \ 61 wifi-service \ 62 truth-prebuilt \ 63 64 LOCAL_JAVA_LIBRARIES := \ 65 android.test.runner \ 66 android.hidl.manager-V1.2-java \ 67 android.test.base \ 68 android.test.mock 69 70 # These must be explicitly included because they are not normally accessible 71 # from apps. 72 LOCAL_JNI_SHARED_LIBRARIES := \ 73 libcrypto \ 74 libwifi-service \ 75 libEGL \ 76 libGLESv2 \ 77 libaudioutils \ 78 libbacktrace \ 79 libbase \ 80 libbinder \ 81 libbinderthreadstate \ 82 libc++ \ 83 ld-android \ 84 libdl_android \ 85 libcamera_client \ 86 libcamera_metadata \ 87 libcgrouprc \ 88 libcutils \ 89 libexpat \ 90 libgui \ 91 libhardware \ 92 libandroidicu \ 93 libjsoncpp \ 94 liblzma \ 95 libmedia \ 96 libnativehelper \ 97 libnbaio \ 98 libnetutils \ 99 libnl \ 100 libpowermanager \ 101 libprocessgroup \ 102 libsonivox \ 103 libstagefright_foundation \ 104 libstdc++ \ 105 libsync \ 106 libwifi-system \ 107 libui \ 108 libunwindstack \ 109 libutils \ 110 libvndksupport \ 111 libdexmakerjvmtiagent \ 112 libstaticjvmtiagent 113 114 ifdef WPA_SUPPLICANT_VERSION 115 LOCAL_JNI_SHARED_LIBRARIES += libwpa_client 116 endif 117 118 LOCAL_PACKAGE_NAME := FrameworksWifiTests 119 LOCAL_PRIVATE_PLATFORM_APIS := true 120 121 LOCAL_COMPATIBILITY_SUITE := device-tests 122 123 include $(BUILD_PACKAGE) 124