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