1 # 2 # Copyright (C) 2014 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 # ========================================================== 18 # Setup some common variables for the different build 19 # targets here. 20 # ========================================================== 21 LOCAL_PATH:= $(call my-dir) 22 23 testFiles := \ 24 AttributeFinder_test.cpp \ 25 ByteBucketArray_test.cpp \ 26 Config_test.cpp \ 27 ConfigLocale_test.cpp \ 28 Idmap_test.cpp \ 29 ResTable_test.cpp \ 30 Split_test.cpp \ 31 TestHelpers.cpp \ 32 Theme_test.cpp \ 33 TypeWrappers_test.cpp \ 34 ZipUtils_test.cpp 35 36 androidfw_test_cflags := \ 37 -Wall \ 38 -Werror \ 39 -Wunused \ 40 -Wunreachable-code \ 41 -Wno-missing-field-initializers \ 42 43 # gtest is broken. 44 androidfw_test_cflags += -Wno-unnamed-type-template-args 45 46 # ========================================================== 47 # Build the host tests: libandroidfw_tests 48 # ========================================================== 49 include $(CLEAR_VARS) 50 51 LOCAL_MODULE := libandroidfw_tests 52 LOCAL_CFLAGS := $(androidfw_test_cflags) 53 LOCAL_SRC_FILES := $(testFiles) 54 LOCAL_STATIC_LIBRARIES := \ 55 libandroidfw \ 56 libutils \ 57 libcutils \ 58 liblog \ 59 libz \ 60 61 include $(BUILD_HOST_NATIVE_TEST) 62 63 # ========================================================== 64 # Build the device tests: libandroidfw_tests 65 # ========================================================== 66 ifneq ($(SDK_ONLY),true) 67 include $(CLEAR_VARS) 68 69 LOCAL_MODULE := libandroidfw_tests 70 LOCAL_CFLAGS := $(androidfw_test_cflags) 71 LOCAL_SRC_FILES := $(testFiles) \ 72 BackupData_test.cpp \ 73 ObbFile_test.cpp \ 74 75 LOCAL_SHARED_LIBRARIES := \ 76 libandroidfw \ 77 libcutils \ 78 libutils \ 79 libui \ 80 81 include $(BUILD_NATIVE_TEST) 82 endif # Not SDK_ONLY 83 84