Android.mk revision ea7897954f6339dcc2e5af1584f72c6b2ecd7a67
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# ========================================================== 21LOCAL_PATH:= $(call my-dir) 22 23testFiles := \ 24 AppAsLib_test.cpp \ 25 Asset_test.cpp \ 26 AttributeFinder_test.cpp \ 27 ByteBucketArray_test.cpp \ 28 Config_test.cpp \ 29 ConfigLocale_test.cpp \ 30 Idmap_test.cpp \ 31 Main.cpp \ 32 ResTable_test.cpp \ 33 Split_test.cpp \ 34 TestHelpers.cpp \ 35 Theme_test.cpp \ 36 TypeWrappers_test.cpp \ 37 ZipUtils_test.cpp 38 39androidfw_test_cflags := \ 40 -Wall \ 41 -Werror \ 42 -Wunused \ 43 -Wunreachable-code \ 44 -Wno-missing-field-initializers 45 46# gtest is broken. 47androidfw_test_cflags += -Wno-unnamed-type-template-args 48 49# ========================================================== 50# Build the host tests: libandroidfw_tests 51# ========================================================== 52include $(CLEAR_VARS) 53 54LOCAL_MODULE := libandroidfw_tests 55LOCAL_CFLAGS := $(androidfw_test_cflags) 56LOCAL_SRC_FILES := $(testFiles) AttributeResolution_test.cpp 57LOCAL_STATIC_LIBRARIES := \ 58 libandroidfw \ 59 libbase \ 60 libutils \ 61 libcutils \ 62 liblog \ 63 libz 64LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data 65 66include $(BUILD_HOST_NATIVE_TEST) 67 68# ========================================================== 69# Build the device tests: libandroidfw_tests 70# ========================================================== 71ifneq ($(SDK_ONLY),true) 72include $(CLEAR_VARS) 73 74LOCAL_MODULE := libandroidfw_tests 75LOCAL_CFLAGS := $(androidfw_test_cflags) 76LOCAL_SRC_FILES := $(testFiles) \ 77 BackupData_test.cpp \ 78 ObbFile_test.cpp \ 79 80LOCAL_SHARED_LIBRARIES := \ 81 libandroidfw \ 82 libbase \ 83 libcutils \ 84 libutils \ 85 libui 86LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data 87 88include $(BUILD_NATIVE_TEST) 89endif # Not SDK_ONLY 90 91