Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 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 | # ========================================================== |
Adam Lesinski | 16c4d15 | 2014-01-24 13:27:13 -0800 | [diff] [blame] | 21 | LOCAL_PATH:= $(call my-dir) |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 22 | |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 23 | testFiles := \ |
Tao Bai | a6d7e3f | 2015-09-01 18:49:54 -0700 | [diff] [blame] | 24 | AppAsLib_test.cpp \ |
Adam Lesinski | 0358efe | 2016-10-17 13:50:56 -0700 | [diff] [blame] | 25 | Asset_test.cpp \ |
Adam Lesinski | a7d1d73 | 2014-10-01 18:24:54 -0700 | [diff] [blame] | 26 | AttributeFinder_test.cpp \ |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 27 | ByteBucketArray_test.cpp \ |
Adam Lesinski | 31245b4 | 2014-08-22 19:10:56 -0700 | [diff] [blame] | 28 | Config_test.cpp \ |
| 29 | ConfigLocale_test.cpp \ |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 30 | Idmap_test.cpp \ |
Adam Lesinski | ea78979 | 2016-11-10 14:33:11 -0800 | [diff] [blame] | 31 | Main.cpp \ |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 32 | ResTable_test.cpp \ |
| 33 | Split_test.cpp \ |
Adam Lesinski | 6029319 | 2014-10-21 18:36:42 -0700 | [diff] [blame] | 34 | TestHelpers.cpp \ |
Adam Lesinski | 9d9cc62 | 2014-08-29 14:10:04 -0700 | [diff] [blame] | 35 | Theme_test.cpp \ |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 36 | TypeWrappers_test.cpp \ |
| 37 | ZipUtils_test.cpp |
| 38 | |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 39 | androidfw_test_cflags := \ |
| 40 | -Wall \ |
| 41 | -Werror \ |
| 42 | -Wunused \ |
| 43 | -Wunreachable-code \ |
Adam Lesinski | 7a37b74 | 2016-10-12 14:05:55 -0700 | [diff] [blame] | 44 | -Wno-missing-field-initializers |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 45 | |
| 46 | # gtest is broken. |
| 47 | androidfw_test_cflags += -Wno-unnamed-type-template-args |
| 48 | |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 49 | # ========================================================== |
| 50 | # Build the host tests: libandroidfw_tests |
| 51 | # ========================================================== |
Adam Lesinski | 16c4d15 | 2014-01-24 13:27:13 -0800 | [diff] [blame] | 52 | include $(CLEAR_VARS) |
| 53 | |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 54 | LOCAL_MODULE := libandroidfw_tests |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 55 | LOCAL_CFLAGS := $(androidfw_test_cflags) |
Adam Lesinski | 7a37b74 | 2016-10-12 14:05:55 -0700 | [diff] [blame] | 56 | LOCAL_SRC_FILES := $(testFiles) AttributeResolution_test.cpp |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 57 | LOCAL_STATIC_LIBRARIES := \ |
| 58 | libandroidfw \ |
Adam Lesinski | 7a37b74 | 2016-10-12 14:05:55 -0700 | [diff] [blame] | 59 | libbase \ |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 60 | libutils \ |
| 61 | libcutils \ |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 62 | liblog \ |
Adam Lesinski | ea78979 | 2016-11-10 14:33:11 -0800 | [diff] [blame] | 63 | libz |
| 64 | LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 65 | |
| 66 | include $(BUILD_HOST_NATIVE_TEST) |
| 67 | |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 68 | # ========================================================== |
| 69 | # Build the device tests: libandroidfw_tests |
| 70 | # ========================================================== |
Adam Lesinski | f001e37 | 2014-10-20 16:15:33 -0700 | [diff] [blame] | 71 | ifneq ($(SDK_ONLY),true) |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 72 | include $(CLEAR_VARS) |
| 73 | |
| 74 | LOCAL_MODULE := libandroidfw_tests |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 75 | LOCAL_CFLAGS := $(androidfw_test_cflags) |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 76 | LOCAL_SRC_FILES := $(testFiles) \ |
| 77 | BackupData_test.cpp \ |
Dan Albert | 1b4f316 | 2015-04-07 18:43:15 -0700 | [diff] [blame] | 78 | ObbFile_test.cpp \ |
| 79 | |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 80 | LOCAL_SHARED_LIBRARIES := \ |
Adam Lesinski | 16c4d15 | 2014-01-24 13:27:13 -0800 | [diff] [blame] | 81 | libandroidfw \ |
Adam Lesinski | 7a37b74 | 2016-10-12 14:05:55 -0700 | [diff] [blame] | 82 | libbase \ |
Adam Lesinski | 16c4d15 | 2014-01-24 13:27:13 -0800 | [diff] [blame] | 83 | libcutils \ |
| 84 | libutils \ |
Adam Lesinski | ea78979 | 2016-11-10 14:33:11 -0800 | [diff] [blame] | 85 | libui |
| 86 | LOCAL_PICKUP_FILES := $(LOCAL_PATH)/data |
Adam Lesinski | 16c4d15 | 2014-01-24 13:27:13 -0800 | [diff] [blame] | 87 | |
Adam Lesinski | f90f2f8d | 2014-06-06 14:27:00 -0700 | [diff] [blame] | 88 | include $(BUILD_NATIVE_TEST) |
Adam Lesinski | f001e37 | 2014-10-20 16:15:33 -0700 | [diff] [blame] | 89 | endif # Not SDK_ONLY |
| 90 | |