blob: b3584fe87a212aab1afacb7a566b7cd8e190b7a4 [file] [log] [blame]
Dan Albert13f21c22014-10-16 17:39:31 -07001#
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 Root7a4adb52013-10-09 10:14:35 -070017LOCAL_PATH := $(call my-dir)
Dan Albert13f21c22014-10-16 17:39:31 -070018
Jed Estep43291862016-02-03 17:02:09 -080019# Unit tests
20include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070021LOCAL_CFLAGS := -Wall -Werror
Jed Estep43291862016-02-03 17:02:09 -080022LOCAL_MODULE := recovery_unit_test
Dan Shi73683162017-03-28 17:22:41 -070023LOCAL_COMPATIBILITY_SUITE := device-tests
Tianjie Xu2430e292016-04-19 15:02:41 -070024LOCAL_STATIC_LIBRARIES := \
25 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070026 libminui \
27 libotautil \
Tao Bao8f237572017-03-26 13:36:49 -070028 libupdater \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070029 libziparchive \
30 libutils \
31 libz \
32 libselinux \
Tianjie Xua88cc542017-10-25 13:16:54 -070033 libbase \
34 libBionicGtestMain
Tianjie Xu2430e292016-04-19 15:02:41 -070035
Tao Baoc3292f32016-11-04 10:52:13 -070036LOCAL_SRC_FILES := \
37 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080038 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070039 unit/locale_test.cpp \
Tao Bao8f237572017-03-26 13:36:49 -070040 unit/rangeset_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070041 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080042 unit/zip_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070043
Jed Estep43291862016-02-03 17:02:09 -080044LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080045LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080046include $(BUILD_NATIVE_TEST)
47
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080048# Manual tests
49include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070050LOCAL_CFLAGS := -Wall -Werror
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080051LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080052LOCAL_STATIC_LIBRARIES := \
53 libminui \
Tianjie Xua88cc542017-10-25 13:16:54 -070054 libbase \
55 libBionicGtestMain
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080056
57LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080058LOCAL_SHARED_LIBRARIES := \
59 liblog \
60 libpng
61
62resource_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.
72testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
73GEN := $(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)
79LOCAL_GENERATED_SOURCES += $(GEN)
80
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080081include $(BUILD_NATIVE_TEST)
82
Jed Estep43291862016-02-03 17:02:09 -080083# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070084include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070085LOCAL_CFLAGS := \
Tianjie Xuc89d1e72017-08-28 14:15:07 -070086 -Wall \
Tianjie Xu56ebe622017-03-16 00:48:21 -070087 -Werror \
88 -D_FILE_OFFSET_BITS=64
89
Tao Baobc4b1fe2017-04-17 16:46:05 -070090ifeq ($(AB_OTA_UPDATER),true)
91LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
92endif
93
Tao Bao83b07802017-04-26 14:30:56 -070094ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
95LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
96endif
97
David Zeuthen8ed97382017-05-08 13:41:28 -040098ifeq ($(BOARD_AVB_ENABLE),true)
99LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1
100endif
101
Jed Estep43291862016-02-03 17:02:09 -0800102LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -0700103LOCAL_COMPATIBILITY_SUITE := device-tests
Jed Estep43291862016-02-03 17:02:09 -0800104LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -0800105LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700106 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -0800107 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -0700108 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -0800109 component/imgdiff_test.cpp \
Tao Bao1d866052017-04-10 16:55:57 -0700110 component/install_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -0800111 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -0800112 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700113 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -0700114 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700115 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -0800116
Tao Bao3e2345e2017-08-09 16:33:07 -0700117LOCAL_SHARED_LIBRARIES := \
118 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -0700119
120tune2fs_static_libraries := \
121 libext2_com_err \
122 libext2_blkid \
123 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800124 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700125 libext2_e2p \
126 libext2fs
127
Jed Estep43291862016-02-03 17:02:09 -0800128LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700129 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -0800130 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700131 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800132 libimgdiff \
133 libimgpatch \
134 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700135 libbspatch \
Tao Baoed138192017-05-01 22:30:39 -0700136 libfusesideload \
Jed Estepb8a693b2016-03-09 17:51:34 -0800137 libotafault \
Tao Bao1d866052017-04-10 16:55:57 -0700138 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700139 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800140 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800141 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700142 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700143 libmounts \
Tao Bao83b07802017-04-26 14:30:56 -0700144 libupdate_verifier \
Tao Bao97555da2016-12-15 10:15:06 -0800145 libdivsufsort \
146 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800147 libfs_mgr \
Tao Bao919d2c92017-04-10 16:55:57 -0700148 libvintf_recovery \
149 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800150 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700151 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700152 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800153 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800154 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700155 libcrypto_utils \
156 libcrypto \
Jed Estepb8a693b2016-03-09 17:51:34 -0800157 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800158 libziparchive \
Tao Bao646b05a2017-09-28 17:43:53 -0700159 liblog \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800160 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800161 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700162 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700163 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700164 libfec \
165 libfec_rs \
166 libsquashfs_utils \
167 libcutils \
Tianjie Xu107a34f2017-06-29 17:04:21 -0700168 libbrotli \
Tianjie Xua88cc542017-10-25 13:16:54 -0700169 libBionicGtestMain \
Tao Bao0c7839a2016-10-10 15:48:37 -0700170 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800171
Jed Estep43291862016-02-03 17:02:09 -0800172testdata_files := $(call find-subdir-files, testdata/*)
173
Tao Bao4102b282016-11-02 16:17:17 -0700174# The testdata files that will go to $OUT/data/nativetest/recovery.
175testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800176GEN := $(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)
181LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700182
Tao Bao4102b282016-11-02 16:17:17 -0700183# A copy of the testdata to be packed into continuous_native_tests.zip.
184testdata_continuous_zip_prefix := \
185 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
186testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
187GEN := $(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 Baof1338fb2016-10-25 15:05:40 -0700191 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700192LOCAL_GENERATED_SOURCES += $(GEN)
193LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700194
Dan Albert13f21c22014-10-16 17:39:31 -0700195include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800196
197# Host tests
198include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700199LOCAL_CFLAGS := -Wall -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800200LOCAL_MODULE := recovery_host_test
201LOCAL_MODULE_HOST_OS := linux
202LOCAL_C_INCLUDES := bootable/recovery
203LOCAL_SRC_FILES := \
204 component/imgdiff_test.cpp
205LOCAL_STATIC_LIBRARIES := \
206 libimgdiff \
207 libimgpatch \
Tao Bao09e468f2017-09-29 14:39:33 -0700208 libotautil \
Tao Bao97555da2016-12-15 10:15:06 -0800209 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700210 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800211 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800212 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800213 libbase \
214 libcrypto \
Tianjie Xu8c280812017-10-28 22:13:16 -0700215 libbrotli \
Tao Bao97555da2016-12-15 10:15:06 -0800216 libbz \
217 libdivsufsort64 \
218 libdivsufsort \
Tianjie Xua88cc542017-10-25 13:16:54 -0700219 libz \
220 libBionicGtestMain
Tao Bao97555da2016-12-15 10:15:06 -0800221LOCAL_SHARED_LIBRARIES := \
222 liblog
223include $(BUILD_HOST_NATIVE_TEST)