blob: a353575b4073e3929a94fb8d5722446bb664a981 [file] [log] [blame]
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -07001#
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# ==========================================================
Adam Lesinski16c4d152014-01-24 13:27:13 -080021LOCAL_PATH:= $(call my-dir)
Dan Albert1b4f3162015-04-07 18:43:15 -070022
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070023testFiles := \
Adam Lesinskia7d1d732014-10-01 18:24:54 -070024 AttributeFinder_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070025 ByteBucketArray_test.cpp \
Adam Lesinski31245b42014-08-22 19:10:56 -070026 Config_test.cpp \
27 ConfigLocale_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070028 Idmap_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070029 ResTable_test.cpp \
30 Split_test.cpp \
Adam Lesinski60293192014-10-21 18:36:42 -070031 TestHelpers.cpp \
Adam Lesinski9d9cc622014-08-29 14:10:04 -070032 Theme_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070033 TypeWrappers_test.cpp \
34 ZipUtils_test.cpp
35
Dan Albert1b4f3162015-04-07 18:43:15 -070036androidfw_test_cflags := \
37 -Wall \
38 -Werror \
39 -Wunused \
40 -Wunreachable-code \
41 -Wno-missing-field-initializers \
42
43# gtest is broken.
44androidfw_test_cflags += -Wno-unnamed-type-template-args
45
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070046# ==========================================================
47# Build the host tests: libandroidfw_tests
48# ==========================================================
Adam Lesinski16c4d152014-01-24 13:27:13 -080049include $(CLEAR_VARS)
50
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070051LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070052LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070053LOCAL_SRC_FILES := $(testFiles)
54LOCAL_STATIC_LIBRARIES := \
55 libandroidfw \
56 libutils \
57 libcutils \
Dan Albert1b4f3162015-04-07 18:43:15 -070058 liblog \
59 libz \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070060
61include $(BUILD_HOST_NATIVE_TEST)
62
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070063# ==========================================================
64# Build the device tests: libandroidfw_tests
65# ==========================================================
Adam Lesinskif001e372014-10-20 16:15:33 -070066ifneq ($(SDK_ONLY),true)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070067include $(CLEAR_VARS)
68
69LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070070LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070071LOCAL_SRC_FILES := $(testFiles) \
72 BackupData_test.cpp \
Dan Albert1b4f3162015-04-07 18:43:15 -070073 ObbFile_test.cpp \
74
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070075LOCAL_SHARED_LIBRARIES := \
Adam Lesinski16c4d152014-01-24 13:27:13 -080076 libandroidfw \
77 libcutils \
78 libutils \
79 libui \
Adam Lesinski16c4d152014-01-24 13:27:13 -080080
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070081include $(BUILD_NATIVE_TEST)
Adam Lesinskif001e372014-10-20 16:15:33 -070082endif # Not SDK_ONLY
83