Home | History | Annotate | Download | only in tests
      1 # Copyright (C) 2017 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 # This list is generated from the java source files in this module
     26 # The list is a comma separated list of class names with * matching zero or more characters.
     27 # Example:
     28 #   Input files: src/com/android/server/lowpan/Test.java src/com/android/server/lowpan/AnotherTest.java
     29 #   Generated exclude list: com.android.server.lowpan.Test*,com.android.server.lowpan.AnotherTest*
     30 
     31 # Filter all src files to just java files
     32 local_java_files := $(filter %.java,$(LOCAL_SRC_FILES))
     33 # Transform java file names into full class names.
     34 # This only works if the class name matches the file name and the directory structure
     35 # matches the package.
     36 local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
     37 # Utility variables to allow replacing a space with a comma
     38 comma:= ,
     39 empty:=
     40 space:= $(empty) $(empty)
     41 # Convert class name list to jacoco exclude list
     42 # This appends a * to all classes and replace the space separators with commas.
     43 # These patterns will match all classes in this module and their inner classes.
     44 jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
     45 
     46 jacoco_include := android.net.lowpan.*
     47 
     48 LOCAL_JACK_COVERAGE_INCLUDE_FILTER := $(jacoco_include)
     49 LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude)
     50 
     51 LOCAL_STATIC_JAVA_LIBRARIES := \
     52 	android-support-test \
     53 	guava \
     54 	mockito-target-minus-junit4 \
     55 	frameworks-base-testutils \
     56 
     57 LOCAL_JNI_SHARED_LIBRARIES += libframeworkslowpantestsjni
     58 LOCAL_JNI_SHARED_LIBRARIES += libandroid_net_lowpan
     59 LOCAL_JNI_SHARED_LIBRARIES += \
     60     libbacktrace \
     61     libbase \
     62     libbinder \
     63     libc++ \
     64     libcutils \
     65     liblog \
     66     liblzma \
     67     libnativehelper \
     68     libnetdaidl \
     69     libui \
     70     libunwind \
     71     libutils \
     72     libvndksupport \
     73     libcrypto \
     74     libhidl-gen-utils \
     75     libhidlbase \
     76     libhidltransport \
     77     libpackagelistparser \
     78     libpcre2 \
     79     libselinux \
     80     libtinyxml2 \
     81     libvintf \
     82     libhwbinder \
     83     android.hidl.token (a] 1.0
     84 
     85 LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
     86 
     87 LOCAL_PACKAGE_NAME := FrameworksLowpanApiNativeTests
     88 LOCAL_PRIVATE_PLATFORM_APIS := true
     89 LOCAL_COMPATIBILITY_SUITE := device-tests
     90 
     91 LOCAL_CERTIFICATE := platform
     92 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
     93 include $(BUILD_PACKAGE)
     94 
     95 #########################################################################
     96 # Build JNI Shared Library
     97 #########################################################################
     98 
     99 LOCAL_PATH:= $(LOCAL_PATH)/jni
    100 
    101 include $(CLEAR_VARS)
    102 
    103 LOCAL_MODULE_TAGS := tests
    104 
    105 LOCAL_CFLAGS := -Wall -Wextra -Werror
    106 
    107 LOCAL_SRC_FILES := $(call all-cpp-files-under)
    108 
    109 LOCAL_SHARED_LIBRARIES += libandroid_net_lowpan
    110 LOCAL_SHARED_LIBRARIES += libbinder
    111 LOCAL_SHARED_LIBRARIES += liblog
    112 
    113 LOCAL_MODULE := libframeworkslowpantestsjni
    114 
    115 include $(BUILD_SHARED_LIBRARY)
    116