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