blob: 6837f25b21eca0b4c0e5f5221102c265fc40ba1e [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 Lesinskif90f2f8d2014-06-06 14:27:00 -070031 ResTable_test.cpp \
32 Split_test.cpp \
Adam Lesinski60293192014-10-21 18:36:42 -070033 TestHelpers.cpp \
Adam Lesinski9d9cc622014-08-29 14:10:04 -070034 Theme_test.cpp \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070035 TypeWrappers_test.cpp \
36 ZipUtils_test.cpp
37
Dan Albert1b4f3162015-04-07 18:43:15 -070038androidfw_test_cflags := \
39 -Wall \
40 -Werror \
41 -Wunused \
42 -Wunreachable-code \
Adam Lesinski7a37b742016-10-12 14:05:55 -070043 -Wno-missing-field-initializers
Dan Albert1b4f3162015-04-07 18:43:15 -070044
45# gtest is broken.
46androidfw_test_cflags += -Wno-unnamed-type-template-args
47
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070048# ==========================================================
49# Build the host tests: libandroidfw_tests
50# ==========================================================
Adam Lesinski16c4d152014-01-24 13:27:13 -080051include $(CLEAR_VARS)
52
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070053LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070054LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinski7a37b742016-10-12 14:05:55 -070055LOCAL_SRC_FILES := $(testFiles) AttributeResolution_test.cpp
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070056LOCAL_STATIC_LIBRARIES := \
57 libandroidfw \
Adam Lesinski7a37b742016-10-12 14:05:55 -070058 libbase \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070059 libutils \
60 libcutils \
Dan Albert1b4f3162015-04-07 18:43:15 -070061 liblog \
62 libz \
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070063
64include $(BUILD_HOST_NATIVE_TEST)
65
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070066# ==========================================================
67# Build the device tests: libandroidfw_tests
68# ==========================================================
Adam Lesinskif001e372014-10-20 16:15:33 -070069ifneq ($(SDK_ONLY),true)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070070include $(CLEAR_VARS)
71
72LOCAL_MODULE := libandroidfw_tests
Dan Albert1b4f3162015-04-07 18:43:15 -070073LOCAL_CFLAGS := $(androidfw_test_cflags)
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070074LOCAL_SRC_FILES := $(testFiles) \
75 BackupData_test.cpp \
Dan Albert1b4f3162015-04-07 18:43:15 -070076 ObbFile_test.cpp \
77
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070078LOCAL_SHARED_LIBRARIES := \
Adam Lesinski16c4d152014-01-24 13:27:13 -080079 libandroidfw \
Adam Lesinski7a37b742016-10-12 14:05:55 -070080 libbase \
Adam Lesinski16c4d152014-01-24 13:27:13 -080081 libcutils \
82 libutils \
83 libui \
Adam Lesinski16c4d152014-01-24 13:27:13 -080084
Adam Lesinskif90f2f8d2014-06-06 14:27:00 -070085include $(BUILD_NATIVE_TEST)
Adam Lesinskif001e372014-10-20 16:15:33 -070086endif # Not SDK_ONLY
87