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