Android.mk revision 7ad1110ecd6a840fcd2895c62668828a1ca029c6
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    ApkAssets_test.cpp \
25    AppAsLib_test.cpp \
26    Asset_test.cpp \
27    AssetManager2_test.cpp \
28    AttributeFinder_test.cpp \
29    AttributeResolution_test.cpp \
30    ByteBucketArray_test.cpp \
31    Config_test.cpp \
32    ConfigLocale_test.cpp \
33    Idmap_test.cpp \
34    LoadedArsc_test.cpp \
35    ResTable_test.cpp \
36    Split_test.cpp \
37    TestHelpers.cpp \
38    TestMain.cpp \
39    Theme_test.cpp \
40    TypeWrappers_test.cpp \
41    ZipUtils_test.cpp
42
43benchmarkFiles := \
44    AssetManager2_bench.cpp \
45    BenchMain.cpp \
46    TestHelpers.cpp \
47    Theme_bench.cpp
48
49androidfw_test_cflags := \
50    -Wall \
51    -Werror \
52    -Wunused \
53    -Wunreachable-code \
54    -Wno-missing-field-initializers
55
56# gtest is broken.
57androidfw_test_cflags += -Wno-unnamed-type-template-args
58
59# ==========================================================
60# Build the host tests: libandroidfw_tests
61# ==========================================================
62include $(CLEAR_VARS)
63
64LOCAL_MODULE := libandroidfw_tests
65LOCAL_CFLAGS := $(androidfw_test_cflags)
66LOCAL_SRC_FILES := $(testFiles)
67LOCAL_STATIC_LIBRARIES := \
68    libandroidfw \
69    libbase \
70    libutils \
71    libcutils \
72    liblog \
73    libz \
74    libziparchive
75LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data
76
77include $(BUILD_HOST_NATIVE_TEST)
78
79# ==========================================================
80# Build the device tests: libandroidfw_tests
81# ==========================================================
82ifneq ($(SDK_ONLY),true)
83include $(CLEAR_VARS)
84
85LOCAL_MODULE := libandroidfw_tests
86LOCAL_CFLAGS := $(androidfw_test_cflags)
87LOCAL_SRC_FILES := $(testFiles) \
88    BackupData_test.cpp \
89    ObbFile_test.cpp \
90
91LOCAL_SHARED_LIBRARIES := \
92    libandroidfw \
93    libbase \
94    libcutils \
95    libutils \
96    libui \
97    libziparchive 
98LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data
99
100include $(BUILD_NATIVE_TEST)
101
102# ==========================================================
103# Build the device benchmarks: libandroidfw_benchmarks
104# ==========================================================
105include $(CLEAR_VARS)
106
107LOCAL_MODULE := libandroidfw_benchmarks
108LOCAL_CFLAGS := $(androidfw_test_cflags)
109LOCAL_SRC_FILES := $(benchmarkFiles)
110LOCAL_STATIC_LIBRARIES := \
111    libgoogle-benchmark
112LOCAL_SHARED_LIBRARIES := \
113    libandroidfw \
114    libbase \
115    libcutils \
116    libutils \
117    libziparchive
118LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data
119
120include $(BUILD_NATIVE_TEST)
121endif # Not SDK_ONLY
122
123