blob: d18cb8f472c703c212ecf4641ec5575eb3282a9b [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 Lesinski0358efe2016-10-17 13:50:56 -070025 Asset_test.cpp \
Adam Lesinskia7d1d732014-10-01 18:24:54 -070026 AttributeFinder_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070027 ByteBucketArray_test.cpp \
Adam Lesinski31245b42014-08-22 19:10:56 -070028 Config_test.cpp \
29 ConfigLocale_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070030 Idmap_test.cpp \
Adam Lesinskiea789792016-11-10 14:33:11 -080031 Main.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070032 ResTable_test.cpp \
33 Split_test.cpp \
Adam Lesinski60293192014-10-21 18:36:42 -070034 TestHelpers.cpp \
Adam Lesinski9d9cc622014-08-29 14:10:04 -070035 Theme_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070036 TypeWrappers_test.cpp \
37 ZipUtils_test.cpp
38
Dan Albert1b4f3162015-04-07 18:43:15 -070039androidfw_test_cflags := \
40 -Wall \
41 -Werror \
42 -Wunused \
43 -Wunreachable-code \
Adam Lesinski7a37b742016-10-12 14:05:55 -070044 -Wno-missing-field-initializers
Dan Albert1b4f3162015-04-07 18:43:15 -070045
46# gtest is broken.
47androidfw_test_cflags += -Wno-unnamed-type-template-args
48
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070049# ==========================================================
50# Build the host tests: libandroidfw_tests
51# ==========================================================
Adam Lesinski16c4d152014-01-24 13:27:13 -080052include $(CLEAR_VARS)
53
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070054LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070055LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinski7a37b742016-10-12 14:05:55 -070056LOCAL_SRC_FILES := $(testFiles) AttributeResolution_test.cpp
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070057LOCAL_STATIC_LIBRARIES := \
58 libandroidfw \
Adam Lesinski7a37b742016-10-12 14:05:55 -070059 libbase \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070060 libutils \
61 libcutils \
Dan Albert1b4f3162015-04-07 18:43:15 -070062 liblog \
Adam Lesinskiea789792016-11-10 14:33:11 -080063 libz
64LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070065
66include $(BUILD_HOST_NATIVE_TEST)
67
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070068# ==========================================================
69# Build the device tests: libandroidfw_tests
70# ==========================================================
Adam Lesinskif001e372014-10-20 16:15:33 -070071ifneq ($(SDK_ONLY),true)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070072include $(CLEAR_VARS)
73
74LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070075LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070076LOCAL_SRC_FILES := $(testFiles) \
77 BackupData_test.cpp \
Dan Albert1b4f3162015-04-07 18:43:15 -070078 ObbFile_test.cpp \
79
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070080LOCAL_SHARED_LIBRARIES := \
Adam Lesinski16c4d152014-01-24 13:27:13 -080081 libandroidfw \
Adam Lesinski7a37b742016-10-12 14:05:55 -070082 libbase \
Adam Lesinski16c4d152014-01-24 13:27:13 -080083 libcutils \
84 libutils \
Adam Lesinskiea789792016-11-10 14:33:11 -080085 libui
86LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data
Adam Lesinski16c4d152014-01-24 13:27:13 -080087
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070088include $(BUILD_NATIVE_TEST)
Adam Lesinskif001e372014-10-20 16:15:33 -070089endif # Not SDK_ONLY
90