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