blob: 2bc026b79ca2d3e2f6cc8100e1e48ca8bb0d014b [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 := \
Tao Baia6d7e3f2015-09-01 18:49:54 -070024 AppAsLib_test.cpp \
Adam Lesinskia7d1d732014-10-01 18:24:54 -070025 AttributeFinder_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070026 ByteBucketArray_test.cpp \
Adam Lesinski31245b42014-08-22 19:10:56 -070027 Config_test.cpp \
28 ConfigLocale_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070029 Idmap_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070030 ResTable_test.cpp \
31 Split_test.cpp \
Adam Lesinski60293192014-10-21 18:36:42 -070032 TestHelpers.cpp \
Adam Lesinski9d9cc622014-08-29 14:10:04 -070033 Theme_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070034 TypeWrappers_test.cpp \
35 ZipUtils_test.cpp
36
Dan Albert1b4f3162015-04-07 18:43:15 -070037androidfw_test_cflags := \
38 -Wall \
39 -Werror \
40 -Wunused \
41 -Wunreachable-code \
42 -Wno-missing-field-initializers \
43
44# gtest is broken.
45androidfw_test_cflags += -Wno-unnamed-type-template-args
46
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070047# ==========================================================
48# Build the host tests: libandroidfw_tests
49# ==========================================================
Adam Lesinski16c4d152014-01-24 13:27:13 -080050include $(CLEAR_VARS)
51
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070052LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070053LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070054LOCAL_SRC_FILES := $(testFiles)
55LOCAL_STATIC_LIBRARIES := \
56 libandroidfw \
57 libutils \
58 libcutils \
Dan Albert1b4f3162015-04-07 18:43:15 -070059 liblog \
60 libz \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070061
62include $(BUILD_HOST_NATIVE_TEST)
63
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070064# ==========================================================
65# Build the device tests: libandroidfw_tests
66# ==========================================================
Adam Lesinskif001e372014-10-20 16:15:33 -070067ifneq ($(SDK_ONLY),true)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070068include $(CLEAR_VARS)
69
70LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070071LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070072LOCAL_SRC_FILES := $(testFiles) \
73 BackupData_test.cpp \
Dan Albert1b4f3162015-04-07 18:43:15 -070074 ObbFile_test.cpp \
75
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070076LOCAL_SHARED_LIBRARIES := \
Adam Lesinski16c4d152014-01-24 13:27:13 -080077 libandroidfw \
78 libcutils \
79 libutils \
80 libui \
Adam Lesinski16c4d152014-01-24 13:27:13 -080081
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070082include $(BUILD_NATIVE_TEST)
Adam Lesinskif001e372014-10-20 16:15:33 -070083endif # Not SDK_ONLY
84