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