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