Home | History | Annotate | Download | only in wifitests
      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 # Utility variables to allow replacing a space with a comma
     39 comma:= ,
     40 empty:=
     41 space:= $(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.
     45 jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
     46 
     47 jacoco_include := com.android.server.wifi.*
     48 
     49 LOCAL_JACK_COVERAGE_INCLUDE_FILTER := $(jacoco_include)
     50 LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude)
     51 
     52 LOCAL_DX_FLAGS := --multi-dex
     53 LOCAL_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.
     60 LOCAL_STATIC_JAVA_LIBRARIES := \
     61 	android-support-test \
     62 	mockito-target-minus-junit4 \
     63 	frameworks-base-testutils \
     64 	services \
     65 	wifi-service \
     66 
     67 LOCAL_JAVA_LIBRARIES := \
     68 	android.test.runner \
     69 	wifi-service \
     70 	services \
     71 	android.hidl.manager-V1.0-java
     72 
     73 # These must be explicitly included because they are not normally accessible
     74 # from apps.
     75 LOCAL_JNI_SHARED_LIBRARIES := \
     76 	libcrypto \
     77 	libwifi-service \
     78 	libEGL \
     79 	libGLESv2 \
     80 	libaudioutils \
     81 	libbacktrace \
     82 	libbase \
     83 	libbinder \
     84 	libc++ \
     85 	libcamera_client \
     86 	libcamera_metadata \
     87 	libcutils \
     88 	libexpat \
     89 	libgui \
     90 	libhardware \
     91 	libicui18n \
     92 	libicuuc \
     93 	liblzma \
     94 	libmedia \
     95 	libnativehelper \
     96 	libnbaio \
     97 	libnetutils \
     98 	libnl \
     99 	libpowermanager \
    100 	libsonivox \
    101 	libspeexresampler \
    102 	libstagefright_foundation \
    103 	libstdc++ \
    104 	libsync \
    105 	libwifi-system \
    106 	libui \
    107 	libunwind \
    108 	libutils \
    109 	libvndksupport \
    110 
    111 ifdef WPA_SUPPLICANT_VERSION
    112 LOCAL_JNI_SHARED_LIBRARIES += libwpa_client
    113 endif
    114 
    115 LOCAL_PACKAGE_NAME := FrameworksWifiTests
    116 
    117 LOCAL_COMPATIBILITY_SUITE := device-tests
    118 
    119 include $(BUILD_PACKAGE)
    120