blob: 9a71371fafdbb3fb113b8b3974a241ad5bb1ed68 [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 Xu5fe5eb62018-03-20 16:07:39 -070026 librecovery_ui \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070027 libminui \
28 libotautil \
Tao Bao8f237572017-03-26 13:36:49 -070029 libupdater \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070030 libziparchive \
31 libutils \
32 libz \
33 libselinux \
Tianjie Xua88cc542017-10-25 13:16:54 -070034 libbase \
35 libBionicGtestMain
Tianjie Xu2430e292016-04-19 15:02:41 -070036
Tao Baoc3292f32016-11-04 10:52:13 -070037LOCAL_SRC_FILES := \
38 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080039 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070040 unit/locale_test.cpp \
Tao Bao8f237572017-03-26 13:36:49 -070041 unit/rangeset_test.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070042 unit/screen_ui_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070043 unit/sysutil_test.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070044 unit/zip_test.cpp
Tao Baoc3292f32016-11-04 10:52:13 -070045
Jed Estep43291862016-02-03 17:02:09 -080046LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080047LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080048include $(BUILD_NATIVE_TEST)
49
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080050# Manual tests
51include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070052LOCAL_CFLAGS := -Wall -Werror
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080053LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080054LOCAL_STATIC_LIBRARIES := \
55 libminui \
Tianjie Xua88cc542017-10-25 13:16:54 -070056 libbase \
57 libBionicGtestMain
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080058
59LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080060LOCAL_SHARED_LIBRARIES := \
61 liblog \
62 libpng
63
64resource_files := $(call find-files-in-subdirs, bootable/recovery, \
65 "*_text.png", \
66 res-mdpi/images \
67 res-hdpi/images \
68 res-xhdpi/images \
69 res-xxhdpi/images \
70 res-xxxhdpi/images \
71 )
72
73# The resource image files that will go to $OUT/data/nativetest/recovery.
74testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
75GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
76
77$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
78$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
79$(GEN): $(testimage_out_path)/% : bootable/recovery/%
80 $(transform-generated-source)
81LOCAL_GENERATED_SOURCES += $(GEN)
82
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080083include $(BUILD_NATIVE_TEST)
84
Jed Estep43291862016-02-03 17:02:09 -080085# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070086include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070087LOCAL_CFLAGS := \
Tianjie Xuc89d1e72017-08-28 14:15:07 -070088 -Wall \
Tianjie Xu56ebe622017-03-16 00:48:21 -070089 -Werror \
90 -D_FILE_OFFSET_BITS=64
91
Tao Baobc4b1fe2017-04-17 16:46:05 -070092ifeq ($(AB_OTA_UPDATER),true)
93LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
94endif
95
Tao Bao83b07802017-04-26 14:30:56 -070096ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
97LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
98endif
99
David Zeuthen8ed97382017-05-08 13:41:28 -0400100ifeq ($(BOARD_AVB_ENABLE),true)
101LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1
102endif
103
Jed Estep43291862016-02-03 17:02:09 -0800104LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -0700105LOCAL_COMPATIBILITY_SUITE := device-tests
Jed Estep43291862016-02-03 17:02:09 -0800106LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -0800107LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700108 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -0800109 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -0700110 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -0800111 component/imgdiff_test.cpp \
Tao Bao1d866052017-04-10 16:55:57 -0700112 component/install_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -0800113 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -0800114 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700115 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -0700116 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700117 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -0800118
Tao Bao3e2345e2017-08-09 16:33:07 -0700119LOCAL_SHARED_LIBRARIES := \
120 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -0700121
122tune2fs_static_libraries := \
123 libext2_com_err \
124 libext2_blkid \
125 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800126 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700127 libext2_e2p \
128 libext2fs
129
Jed Estep43291862016-02-03 17:02:09 -0800130LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700131 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -0800132 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700133 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800134 libimgdiff \
135 libimgpatch \
136 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700137 libbspatch \
Tao Baoed138192017-05-01 22:30:39 -0700138 libfusesideload \
Jed Estepb8a693b2016-03-09 17:51:34 -0800139 libotafault \
Tao Bao1d866052017-04-10 16:55:57 -0700140 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700141 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800142 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800143 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700144 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700145 libmounts \
Tao Bao83b07802017-04-26 14:30:56 -0700146 libupdate_verifier \
Tao Bao97555da2016-12-15 10:15:06 -0800147 libdivsufsort \
148 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800149 libfs_mgr \
Tao Bao919d2c92017-04-10 16:55:57 -0700150 libvintf_recovery \
151 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800152 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700153 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700154 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800155 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800156 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700157 libcrypto_utils \
158 libcrypto \
Jed Estepb8a693b2016-03-09 17:51:34 -0800159 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800160 libziparchive \
Tao Bao646b05a2017-09-28 17:43:53 -0700161 liblog \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800162 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800163 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700164 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700165 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700166 libfec \
167 libfec_rs \
168 libsquashfs_utils \
169 libcutils \
Tianjie Xu107a34f2017-06-29 17:04:21 -0700170 libbrotli \
Tianjie Xua88cc542017-10-25 13:16:54 -0700171 libBionicGtestMain \
Tao Bao0c7839a2016-10-10 15:48:37 -0700172 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800173
Jed Estep43291862016-02-03 17:02:09 -0800174testdata_files := $(call find-subdir-files, testdata/*)
175
Tao Bao4102b282016-11-02 16:17:17 -0700176# The testdata files that will go to $OUT/data/nativetest/recovery.
177testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800178GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
179$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
180$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
181$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
182 $(transform-generated-source)
183LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700184
Tao Bao4102b282016-11-02 16:17:17 -0700185# A copy of the testdata to be packed into continuous_native_tests.zip.
186testdata_continuous_zip_prefix := \
187 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
188testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
189GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
190$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
191$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
192$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700193 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700194LOCAL_GENERATED_SOURCES += $(GEN)
195LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700196
Dan Albert13f21c22014-10-16 17:39:31 -0700197include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800198
199# Host tests
200include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700201LOCAL_CFLAGS := -Wall -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800202LOCAL_MODULE := recovery_host_test
203LOCAL_MODULE_HOST_OS := linux
204LOCAL_C_INCLUDES := bootable/recovery
205LOCAL_SRC_FILES := \
206 component/imgdiff_test.cpp
207LOCAL_STATIC_LIBRARIES := \
208 libimgdiff \
209 libimgpatch \
Tao Bao09e468f2017-09-29 14:39:33 -0700210 libotautil \
Tao Bao97555da2016-12-15 10:15:06 -0800211 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700212 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800213 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800214 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800215 libbase \
216 libcrypto \
Tianjie Xu8c280812017-10-28 22:13:16 -0700217 libbrotli \
Tao Bao97555da2016-12-15 10:15:06 -0800218 libbz \
219 libdivsufsort64 \
220 libdivsufsort \
Tianjie Xua88cc542017-10-25 13:16:54 -0700221 libz \
222 libBionicGtestMain
Tao Bao97555da2016-12-15 10:15:06 -0800223LOCAL_SHARED_LIBRARIES := \
224 liblog
225include $(BUILD_HOST_NATIVE_TEST)