Dan Albert | 13f21c2 | 2014-10-16 17:39:31 -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 | |
Kenny Root | 7a4adb5 | 2013-10-09 10:14:35 -0700 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Dan Albert | 13f21c2 | 2014-10-16 17:39:31 -0700 | [diff] [blame] | 18 | |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 19 | ifdef project-path-for |
| 20 | RECOVERY_PATH := $(call project-path-for,recovery) |
| 21 | else |
| 22 | RECOVERY_PATH := bootable/recovery |
| 23 | endif |
| 24 | |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 25 | # Unit tests |
| 26 | include $(CLEAR_VARS) |
Tianjie Xu | 7aa8874 | 2016-09-28 11:42:17 -0700 | [diff] [blame] | 27 | LOCAL_CFLAGS := -Werror |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 28 | LOCAL_MODULE := recovery_unit_test |
Dan Shi | 7368316 | 2017-03-28 17:22:41 -0700 | [diff] [blame] | 29 | LOCAL_COMPATIBILITY_SUITE := device-tests |
Tianjie Xu | 2430e29 | 2016-04-19 15:02:41 -0700 | [diff] [blame] | 30 | LOCAL_STATIC_LIBRARIES := \ |
| 31 | libverifier \ |
Tianjie Xu | 8cf5c8f | 2016-09-08 20:10:11 -0700 | [diff] [blame] | 32 | libminui \ |
| 33 | libotautil \ |
Tao Bao | 8f23757 | 2017-03-26 13:36:49 -0700 | [diff] [blame] | 34 | libupdater \ |
Tianjie Xu | 8cf5c8f | 2016-09-08 20:10:11 -0700 | [diff] [blame] | 35 | libziparchive \ |
| 36 | libutils \ |
| 37 | libz \ |
| 38 | libselinux \ |
| 39 | libbase |
Tianjie Xu | 2430e29 | 2016-04-19 15:02:41 -0700 | [diff] [blame] | 40 | |
Tao Bao | c3292f3 | 2016-11-04 10:52:13 -0700 | [diff] [blame] | 41 | LOCAL_SRC_FILES := \ |
| 42 | unit/asn1_decoder_test.cpp \ |
Tao Bao | f19295c | 2016-12-22 09:28:03 -0800 | [diff] [blame] | 43 | unit/dirutil_test.cpp \ |
Tao Bao | c3292f3 | 2016-11-04 10:52:13 -0700 | [diff] [blame] | 44 | unit/locale_test.cpp \ |
Tao Bao | 8f23757 | 2017-03-26 13:36:49 -0700 | [diff] [blame] | 45 | unit/rangeset_test.cpp \ |
Tao Bao | c3292f3 | 2016-11-04 10:52:13 -0700 | [diff] [blame] | 46 | unit/sysutil_test.cpp \ |
Tao Bao | e7e7b46 | 2016-12-21 17:58:42 -0800 | [diff] [blame] | 47 | unit/zip_test.cpp \ |
Tao Bao | c3292f3 | 2016-11-04 10:52:13 -0700 | [diff] [blame] | 48 | |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 49 | LOCAL_C_INCLUDES := $(RECOVERY_PATH) |
Mark Salyzyn | 13aca59 | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 50 | LOCAL_SHARED_LIBRARIES := liblog |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 51 | include $(BUILD_NATIVE_TEST) |
| 52 | |
Tianjie Xu | 5d8b53b | 2016-11-07 14:45:59 -0800 | [diff] [blame] | 53 | # Manual tests |
Kenny Root | 7a4adb5 | 2013-10-09 10:14:35 -0700 | [diff] [blame] | 54 | include $(CLEAR_VARS) |
Tianjie Xu | 5d8b53b | 2016-11-07 14:45:59 -0800 | [diff] [blame] | 55 | LOCAL_CFLAGS := -Werror |
| 56 | LOCAL_MODULE := recovery_manual_test |
Tianjie Xu | d17a688 | 2017-01-09 11:18:29 -0800 | [diff] [blame] | 57 | LOCAL_STATIC_LIBRARIES := \ |
| 58 | libminui \ |
| 59 | libbase |
Tianjie Xu | 5d8b53b | 2016-11-07 14:45:59 -0800 | [diff] [blame] | 60 | |
| 61 | LOCAL_SRC_FILES := manual/recovery_test.cpp |
Tianjie Xu | d17a688 | 2017-01-09 11:18:29 -0800 | [diff] [blame] | 62 | LOCAL_SHARED_LIBRARIES := \ |
| 63 | liblog \ |
| 64 | libpng |
| 65 | |
| 66 | resource_files := $(call find-files-in-subdirs, bootable/recovery, \ |
| 67 | "*_text.png", \ |
| 68 | res-mdpi/images \ |
| 69 | res-hdpi/images \ |
| 70 | res-xhdpi/images \ |
| 71 | res-xxhdpi/images \ |
| 72 | res-xxxhdpi/images \ |
| 73 | ) |
| 74 | |
| 75 | # The resource image files that will go to $OUT/data/nativetest/recovery. |
| 76 | testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery |
| 77 | GEN := $(addprefix $(testimage_out_path)/, $(resource_files)) |
| 78 | |
| 79 | $(GEN): PRIVATE_PATH := $(LOCAL_PATH) |
| 80 | $(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ |
| 81 | $(GEN): $(testimage_out_path)/% : bootable/recovery/% |
| 82 | $(transform-generated-source) |
| 83 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 84 | |
Tianjie Xu | 5d8b53b | 2016-11-07 14:45:59 -0800 | [diff] [blame] | 85 | include $(BUILD_NATIVE_TEST) |
| 86 | |
Kenny Root | 7a4adb5 | 2013-10-09 10:14:35 -0700 | [diff] [blame] | 87 | # Component tests |
| 88 | include $(CLEAR_VARS) |
Tianjie Xu | 56ebe62 | 2017-03-16 00:48:21 -0700 | [diff] [blame] | 89 | LOCAL_CFLAGS := \ |
| 90 | -Werror \ |
| 91 | -D_FILE_OFFSET_BITS=64 |
| 92 | |
Tao Bao | a233a89 | 2017-04-17 16:46:05 -0700 | [diff] [blame] | 93 | ifeq ($(AB_OTA_UPDATER),true) |
| 94 | LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 |
| 95 | endif |
| 96 | |
Tao Bao | 83b0780 | 2017-04-26 14:30:56 -0700 | [diff] [blame] | 97 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true) |
| 98 | LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1 |
| 99 | endif |
| 100 | |
David Zeuthen | 8ed9738 | 2017-05-08 13:41:28 -0400 | [diff] [blame] | 101 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 102 | LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1 |
| 103 | endif |
| 104 | |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 105 | LOCAL_MODULE := recovery_component_test |
Dan Shi | 7368316 | 2017-03-28 17:22:41 -0700 | [diff] [blame] | 106 | LOCAL_COMPATIBILITY_SUITE := device-tests |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 107 | LOCAL_C_INCLUDES := $(RECOVERY_PATH) |
Jed Estep | b8a693b | 2016-03-09 17:51:34 -0800 | [diff] [blame] | 108 | LOCAL_SRC_FILES := \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 109 | component/applypatch_test.cpp \ |
Tao Bao | 8b7301b | 2016-12-14 15:52:34 -0800 | [diff] [blame] | 110 | component/bootloader_message_test.cpp \ |
Tao Bao | d770d2e | 2016-10-03 15:26:06 -0700 | [diff] [blame] | 111 | component/edify_test.cpp \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 112 | component/imgdiff_test.cpp \ |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 113 | component/install_test.cpp \ |
Wei Wang | b72a15a | 2017-03-02 13:46:37 -0800 | [diff] [blame] | 114 | component/sideload_test.cpp \ |
Tao Bao | 1033408 | 2016-12-12 17:10:20 -0800 | [diff] [blame] | 115 | component/uncrypt_test.cpp \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 116 | component/updater_test.cpp \ |
Tao Bao | 83b0780 | 2017-04-26 14:30:56 -0700 | [diff] [blame] | 117 | component/update_verifier_test.cpp \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 118 | component/verifier_test.cpp |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 119 | |
Tao Bao | 102016c | 2017-08-09 16:33:07 -0700 | [diff] [blame] | 120 | LOCAL_SHARED_LIBRARIES := \ |
| 121 | libhidlbase |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 122 | |
| 123 | tune2fs_static_libraries := \ |
| 124 | libext2_com_err \ |
| 125 | libext2_blkid \ |
| 126 | libext2_quota \ |
Alex Deymo | 7c5dbd6 | 2017-01-13 17:32:20 -0800 | [diff] [blame] | 127 | libext2_uuid \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 128 | libext2_e2p \ |
| 129 | libext2fs |
| 130 | |
Tao Bao | 80e46e0 | 2015-06-03 10:49:29 -0700 | [diff] [blame] | 131 | LOCAL_STATIC_LIBRARIES := \ |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 132 | libapplypatch_modes \ |
Dan Albert | 13f21c2 | 2014-10-16 17:39:31 -0700 | [diff] [blame] | 133 | libapplypatch \ |
Tao Bao | d770d2e | 2016-10-03 15:26:06 -0700 | [diff] [blame] | 134 | libedify \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 135 | libimgdiff \ |
| 136 | libimgpatch \ |
| 137 | libbsdiff \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 138 | libbspatch \ |
Tao Bao | ed13819 | 2017-05-01 22:30:39 -0700 | [diff] [blame] | 139 | libfusesideload \ |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 140 | libotafault \ |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 141 | librecovery \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 142 | libupdater \ |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 143 | libbootloader_message \ |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 144 | libverifier \ |
Tianjie Xu | 8cf5c8f | 2016-09-08 20:10:11 -0700 | [diff] [blame] | 145 | libotautil \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 146 | libmounts \ |
Tao Bao | 83b0780 | 2017-04-26 14:30:56 -0700 | [diff] [blame] | 147 | libupdate_verifier \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 148 | libdivsufsort \ |
| 149 | libdivsufsort64 \ |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 150 | libfs_mgr \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 151 | liblog \ |
Tao Bao | da320ac | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 152 | libvintf_recovery \ |
| 153 | libvintf \ |
| 154 | libtinyxml2 \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 155 | libselinux \ |
Alex Deymo | 3165366 | 2017-01-11 14:02:13 -0800 | [diff] [blame] | 156 | libext4_utils \ |
Alex Deymo | 67f3aa8 | 2017-01-11 14:38:20 -0800 | [diff] [blame] | 157 | libsparse \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 158 | libcrypto_utils \ |
| 159 | libcrypto \ |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 160 | libbz \ |
Tao Bao | ef0eb3b | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 161 | libziparchive \ |
| 162 | libutils \ |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 163 | libz \ |
Tianjie Xu | 7b0ad9c | 2016-08-05 18:00:04 -0700 | [diff] [blame] | 164 | libbase \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 165 | libtune2fs \ |
Tianjie Xu | 56ebe62 | 2017-03-16 00:48:21 -0700 | [diff] [blame] | 166 | libfec \ |
| 167 | libfec_rs \ |
| 168 | libsquashfs_utils \ |
| 169 | libcutils \ |
Tianjie Xu | 107a34f | 2017-06-29 17:04:21 -0700 | [diff] [blame] | 170 | libbrotli \ |
Tao Bao | 0c7839a | 2016-10-10 15:48:37 -0700 | [diff] [blame] | 171 | $(tune2fs_static_libraries) |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 172 | |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 173 | testdata_files := $(call find-subdir-files, testdata/*) |
| 174 | |
Tao Bao | 4102b28 | 2016-11-02 16:17:17 -0700 | [diff] [blame] | 175 | # The testdata files that will go to $OUT/data/nativetest/recovery. |
| 176 | testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery |
Jed Estep | 4329186 | 2016-02-03 17:02:09 -0800 | [diff] [blame] | 177 | GEN := $(addprefix $(testdata_out_path)/, $(testdata_files)) |
| 178 | $(GEN): PRIVATE_PATH := $(LOCAL_PATH) |
| 179 | $(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ |
| 180 | $(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/% |
| 181 | $(transform-generated-source) |
| 182 | LOCAL_GENERATED_SOURCES += $(GEN) |
Tao Bao | f1338fb | 2016-10-25 15:05:40 -0700 | [diff] [blame] | 183 | |
Tao Bao | 4102b28 | 2016-11-02 16:17:17 -0700 | [diff] [blame] | 184 | # A copy of the testdata to be packed into continuous_native_tests.zip. |
| 185 | testdata_continuous_zip_prefix := \ |
| 186 | $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA |
| 187 | testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery |
| 188 | GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files)) |
| 189 | $(GEN): PRIVATE_PATH := $(LOCAL_PATH) |
| 190 | $(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ |
| 191 | $(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/% |
Tao Bao | f1338fb | 2016-10-25 15:05:40 -0700 | [diff] [blame] | 192 | $(transform-generated-source) |
Tao Bao | 4102b28 | 2016-11-02 16:17:17 -0700 | [diff] [blame] | 193 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 194 | LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix) |
Tao Bao | f1338fb | 2016-10-25 15:05:40 -0700 | [diff] [blame] | 195 | |
Dan Albert | 13f21c2 | 2014-10-16 17:39:31 -0700 | [diff] [blame] | 196 | include $(BUILD_NATIVE_TEST) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 197 | |
| 198 | # Host tests |
| 199 | include $(CLEAR_VARS) |
| 200 | LOCAL_CFLAGS := -Werror |
| 201 | LOCAL_MODULE := recovery_host_test |
| 202 | LOCAL_MODULE_HOST_OS := linux |
| 203 | LOCAL_C_INCLUDES := bootable/recovery |
| 204 | LOCAL_SRC_FILES := \ |
| 205 | component/imgdiff_test.cpp |
| 206 | LOCAL_STATIC_LIBRARIES := \ |
| 207 | libimgdiff \ |
| 208 | libimgpatch \ |
| 209 | libbsdiff \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 210 | libbspatch \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 211 | libziparchive \ |
Tianjie Xu | 1ea84d6 | 2017-02-22 18:23:58 -0800 | [diff] [blame] | 212 | libutils \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 213 | libbase \ |
| 214 | libcrypto \ |
| 215 | libbz \ |
| 216 | libdivsufsort64 \ |
| 217 | libdivsufsort \ |
| 218 | libz |
| 219 | LOCAL_SHARED_LIBRARIES := \ |
| 220 | liblog |
| 221 | include $(BUILD_HOST_NATIVE_TEST) |