blob: b0f71a83222bb47cbb2611701fdb1d0c69f3cda0 [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 \
33 libbase
Tianjie Xu2430e292016-04-19 15:02:41 -070034
Tao Baoc3292f32016-11-04 10:52:13 -070035LOCAL_SRC_FILES := \
36 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080037 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070038 unit/locale_test.cpp \
Tao Bao8f237572017-03-26 13:36:49 -070039 unit/rangeset_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070040 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080041 unit/zip_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070042
Jed Estep43291862016-02-03 17:02:09 -080043LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080044LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080045include $(BUILD_NATIVE_TEST)
46
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080047# Manual tests
48include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070049LOCAL_CFLAGS := -Wall -Werror
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080050LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080051LOCAL_STATIC_LIBRARIES := \
52 libminui \
53 libbase
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080054
55LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080056LOCAL_SHARED_LIBRARIES := \
57 liblog \
58 libpng
59
60resource_files := $(call find-files-in-subdirs, bootable/recovery, \
61 "*_text.png", \
62 res-mdpi/images \
63 res-hdpi/images \
64 res-xhdpi/images \
65 res-xxhdpi/images \
66 res-xxxhdpi/images \
67 )
68
69# The resource image files that will go to $OUT/data/nativetest/recovery.
70testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
71GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
72
73$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
74$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
75$(GEN): $(testimage_out_path)/% : bootable/recovery/%
76 $(transform-generated-source)
77LOCAL_GENERATED_SOURCES += $(GEN)
78
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080079include $(BUILD_NATIVE_TEST)
80
Jed Estep43291862016-02-03 17:02:09 -080081# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070082include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070083LOCAL_CFLAGS := \
Tianjie Xuc89d1e72017-08-28 14:15:07 -070084 -Wall \
Tianjie Xu56ebe622017-03-16 00:48:21 -070085 -Werror \
86 -D_FILE_OFFSET_BITS=64
87
Tao Baobc4b1fe2017-04-17 16:46:05 -070088ifeq ($(AB_OTA_UPDATER),true)
89LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
90endif
91
Tao Bao83b07802017-04-26 14:30:56 -070092ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
93LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
94endif
95
David Zeuthen8ed97382017-05-08 13:41:28 -040096ifeq ($(BOARD_AVB_ENABLE),true)
97LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1
98endif
99
Jed Estep43291862016-02-03 17:02:09 -0800100LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -0700101LOCAL_COMPATIBILITY_SUITE := device-tests
Jed Estep43291862016-02-03 17:02:09 -0800102LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -0800103LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700104 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -0800105 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -0700106 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -0800107 component/imgdiff_test.cpp \
Tao Bao1d866052017-04-10 16:55:57 -0700108 component/install_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -0800109 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -0800110 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700111 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -0700112 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700113 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -0800114
Tao Bao3e2345e2017-08-09 16:33:07 -0700115LOCAL_SHARED_LIBRARIES := \
116 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -0700117
118tune2fs_static_libraries := \
119 libext2_com_err \
120 libext2_blkid \
121 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800122 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700123 libext2_e2p \
124 libext2fs
125
Jed Estep43291862016-02-03 17:02:09 -0800126LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700127 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -0800128 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700129 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800130 libimgdiff \
131 libimgpatch \
132 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700133 libbspatch \
Tao Baoed138192017-05-01 22:30:39 -0700134 libfusesideload \
Jed Estepb8a693b2016-03-09 17:51:34 -0800135 libotafault \
Tao Bao1d866052017-04-10 16:55:57 -0700136 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700137 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800138 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800139 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700140 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700141 libmounts \
Tao Bao83b07802017-04-26 14:30:56 -0700142 libupdate_verifier \
Tao Bao97555da2016-12-15 10:15:06 -0800143 libdivsufsort \
144 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800145 libfs_mgr \
Tao Bao919d2c92017-04-10 16:55:57 -0700146 libvintf_recovery \
147 libvintf \
148 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700149 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800150 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800151 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700152 libcrypto_utils \
153 libcrypto \
Jed Estepb8a693b2016-03-09 17:51:34 -0800154 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800155 libziparchive \
Tao Bao646b05a2017-09-28 17:43:53 -0700156 liblog \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800157 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800158 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700159 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700160 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700161 libfec \
162 libfec_rs \
163 libsquashfs_utils \
164 libcutils \
Tianjie Xu107a34f2017-06-29 17:04:21 -0700165 libbrotli \
Tao Bao0c7839a2016-10-10 15:48:37 -0700166 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800167
Jed Estep43291862016-02-03 17:02:09 -0800168testdata_files := $(call find-subdir-files, testdata/*)
169
Tao Bao4102b282016-11-02 16:17:17 -0700170# The testdata files that will go to $OUT/data/nativetest/recovery.
171testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800172GEN := $(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)
177LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700178
Tao Bao4102b282016-11-02 16:17:17 -0700179# A copy of the testdata to be packed into continuous_native_tests.zip.
180testdata_continuous_zip_prefix := \
181 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
182testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
183GEN := $(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 Baof1338fb2016-10-25 15:05:40 -0700187 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700188LOCAL_GENERATED_SOURCES += $(GEN)
189LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700190
Dan Albert13f21c22014-10-16 17:39:31 -0700191include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800192
193# Host tests
194include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700195LOCAL_CFLAGS := -Wall -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800196LOCAL_MODULE := recovery_host_test
197LOCAL_MODULE_HOST_OS := linux
198LOCAL_C_INCLUDES := bootable/recovery
199LOCAL_SRC_FILES := \
200 component/imgdiff_test.cpp
201LOCAL_STATIC_LIBRARIES := \
202 libimgdiff \
203 libimgpatch \
Tao Bao09e468f2017-09-29 14:39:33 -0700204 libotautil \
Tao Bao97555da2016-12-15 10:15:06 -0800205 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700206 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800207 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800208 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800209 libbase \
210 libcrypto \
211 libbz \
212 libdivsufsort64 \
213 libdivsufsort \
214 libz
215LOCAL_SHARED_LIBRARIES := \
216 liblog
217include $(BUILD_HOST_NATIVE_TEST)