15ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# Copyright (C) 2015 The Android Open Source Project 25ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# 35ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# Licensed under the Apache License, Version 2.0 (the "License"); 45ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# you may not use this file except in compliance with the License. 55ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# You may obtain a copy of the License at 65ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# 75ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# http://www.apache.org/licenses/LICENSE-2.0 85ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# 95ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# Unless required by applicable law or agreed to in writing, software 105ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# distributed under the License is distributed on an "AS IS" BASIS, 115ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 125ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# See the License for the specific language governing permissions and 135ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# limitations under the License. 145ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 155ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_PATH:= $(call my-dir) 16956f54b391677d78379729dd14518edddf3c7660Etan Cohen 17956f54b391677d78379729dd14518edddf3c7660Etan Cohen# Make test APK 18956f54b391677d78379729dd14518edddf3c7660Etan Cohen# ============================================================ 195ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Willsinclude $(CLEAR_VARS) 205ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 215ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_MODULE_TAGS := tests 225ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 23c64c0e28b2162b13ca4ac7f9e30767c6d8d3b7eeYing WangLOCAL_SRC_FILES := $(call all-subdir-java-files) 245ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 25a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Provide jack a list of classes to exclude form code coverage 26a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This list is generated from the java source files in this module 27a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# The list is a comma separated list of class names with * matching zero or more characters. 28a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Example: 29a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Input files: src/com/android/server/wifi/Test.java src/com/android/server/wifi/AnotherTest.java 30a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Generated exclude list: com.android.server.wifi.Test*,com.android.server.wifi.AnotherTest* 31a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills 32a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Filter all src files to just java files 33a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willslocal_java_files := $(filter %.java,$(LOCAL_SRC_FILES)) 34a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Transform java file names into full class names. 35a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This only works if the class name matches the file name and the directory structure 36a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# matches the package. 37a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willslocal_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) 38a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Utility variables to allow replacing a space with a comma 39a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willscomma:= , 40a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsempty:= 41a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsspace:= $(empty) $(empty) 42a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Convert class name list to jacoco exclude list 43a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This appends a * to all classes and replace the space separators with commas. 44a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# These patterns will match all classes in this module and their inner classes. 45a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsjacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) 46a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills 479eba9df34d6235da16f2b08be81ac79ae2367f08Peter Qiujacoco_include := com.android.server.wifi.* 48a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills 4905fca10c16c990e610c627f11dabb7552075ba05Sebastien HertzLOCAL_JACK_COVERAGE_INCLUDE_FILTER := $(jacoco_include) 5005fca10c16c990e610c627f11dabb7552075ba05Sebastien HertzLOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude) 51a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills 52b59790ae6a8c10801207f304630a4a98ca771dccColin CrossLOCAL_DX_FLAGS := --multi-dex 53160c5fd3f82eeed7271d0efc44b6a409c9176326Paul DuffinLOCAL_JACK_FLAGS := --multi-dex native 54160c5fd3f82eeed7271d0efc44b6a409c9176326Paul Duffin 552977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# wifi-service and services must be included here so that the latest changes 562977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# will be used when tests. Otherwise the tests would run against the installed 572977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# system. 582977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# TODO figure out if this is the correct thing to do, this seems to not be right 592977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# since neither is declared a static java library. 605ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_STATIC_JAVA_LIBRARIES := \ 615ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills android-support-test \ 62a4c42f56e7068211312e9292972ef4bee3d047c4Mitchell Wills mockito-target-minus-junit4 \ 63f4267b6840dbc7f430638c35c5448187b6e83846Christopher Wiley frameworks-base-testutils \ 642977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills services \ 655ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills wifi-service \ 665ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 672977ce6833c307ce5a597c56060567da4707f8bbMitchell WillsLOCAL_JAVA_LIBRARIES := \ 682977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills android.test.runner \ 695ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills wifi-service \ 702977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills services \ 713d70e79ba897e273fb9fb34a3c17b165a1836fbfBadhri Jagan Sridharan android.hidl.manager-V1.0-java 725ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 732977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# These must be explicitly included because they are not normally accessible 742977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# from apps. 750d83625c25353c92c123f552939eea4b33074b60Mitchell WillsLOCAL_JNI_SHARED_LIBRARIES := \ 76944db7cbdafa91279b40dd8a7737307e49cf711eChristopher Wiley libcrypto \ 770d83625c25353c92c123f552939eea4b33074b60Mitchell Wills libwifi-service \ 78d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libEGL \ 79d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libGLESv2 \ 80d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libaudioutils \ 81d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libbacktrace \ 820d83625c25353c92c123f552939eea4b33074b60Mitchell Wills libbase \ 83d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libbinder \ 84d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libc++ \ 85d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libcamera_client \ 86d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libcamera_metadata \ 870d83625c25353c92c123f552939eea4b33074b60Mitchell Wills libcutils \ 88d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libexpat \ 89d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libgui \ 90d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libhardware \ 91d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libicui18n \ 92d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libicuuc \ 93d39cacb7a5ae9150b3a68b097614c5be697e5751Mitchell Wills liblzma \ 94d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libmedia \ 95d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libnativehelper \ 96d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libnbaio \ 97d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libnetutils \ 98d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libnl \ 99d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libpowermanager \ 100d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libsonivox \ 101d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libspeexresampler \ 102d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libstagefright_foundation \ 103d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libstdc++ \ 104d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libsync \ 10594a1844242a3725d9314f2e2dbcdf0ab58b0f1c1Christopher Wiley libwifi-system \ 106d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libui \ 107d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libunwind \ 108d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills libutils \ 109eaedf421f33097ebf530fb94a1ac1f6ad9ab2ed8Rebecca Silberstein libvndksupport \ 1100d83625c25353c92c123f552939eea4b33074b60Mitchell Wills 11180a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Willsifdef WPA_SUPPLICANT_VERSION 1122977ce6833c307ce5a597c56060567da4707f8bbMitchell WillsLOCAL_JNI_SHARED_LIBRARIES += libwpa_client 11380a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Willsendif 11480a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Wills 1155ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_PACKAGE_NAME := FrameworksWifiTests 1165ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills 1175ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Willsinclude $(BUILD_PACKAGE) 118