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