blob: ff8f3a38e79e199af07a34f690fe2040dd457519 [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
Michael Bestasc86b6d42017-04-28 22:43:09 +030019ifdef project-path-for
20 RECOVERY_PATH := $(call project-path-for,recovery)
21else
22 RECOVERY_PATH := bootable/recovery
23endif
24
Jed Estep43291862016-02-03 17:02:09 -080025# Unit tests
26include $(CLEAR_VARS)
Tianjie Xu7aa88742016-09-28 11:42:17 -070027LOCAL_CFLAGS := -Werror
Jed Estep43291862016-02-03 17:02:09 -080028LOCAL_MODULE := recovery_unit_test
Dan Shi73683162017-03-28 17:22:41 -070029LOCAL_COMPATIBILITY_SUITE := device-tests
Tianjie Xu2430e292016-04-19 15:02:41 -070030LOCAL_STATIC_LIBRARIES := \
31 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070032 libminui \
33 libotautil \
Tao Bao8f237572017-03-26 13:36:49 -070034 libupdater \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070035 libziparchive \
36 libutils \
37 libz \
38 libselinux \
39 libbase
Tianjie Xu2430e292016-04-19 15:02:41 -070040
Tao Baoc3292f32016-11-04 10:52:13 -070041LOCAL_SRC_FILES := \
42 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080043 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070044 unit/locale_test.cpp \
Tao Bao8f237572017-03-26 13:36:49 -070045 unit/rangeset_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070046 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080047 unit/zip_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070048
Michael Bestasc86b6d42017-04-28 22:43:09 +030049LOCAL_C_INCLUDES := $(RECOVERY_PATH)
Mark Salyzyn13aca592016-03-09 14:58:16 -080050LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080051include $(BUILD_NATIVE_TEST)
52
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080053# Manual tests
Kenny Root7a4adb52013-10-09 10:14:35 -070054include $(CLEAR_VARS)
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080055LOCAL_CFLAGS := -Werror
56LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080057LOCAL_STATIC_LIBRARIES := \
58 libminui \
59 libbase
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080060
61LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080062LOCAL_SHARED_LIBRARIES := \
63 liblog \
64 libpng
65
66resource_files := $(call find-files-in-subdirs, bootable/recovery, \
67 "*_text.png", \
68 res-mdpi/images \
69 res-hdpi/images \
70 res-xhdpi/images \
71 res-xxhdpi/images \
72 res-xxxhdpi/images \
73 )
74
75# The resource image files that will go to $OUT/data/nativetest/recovery.
76testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
77GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
78
79$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
80$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
81$(GEN): $(testimage_out_path)/% : bootable/recovery/%
82 $(transform-generated-source)
83LOCAL_GENERATED_SOURCES += $(GEN)
84
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080085include $(BUILD_NATIVE_TEST)
86
Kenny Root7a4adb52013-10-09 10:14:35 -070087# Component tests
88include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070089LOCAL_CFLAGS := \
90 -Werror \
91 -D_FILE_OFFSET_BITS=64
92
Tao Baoa233a892017-04-17 16:46:05 -070093ifeq ($(AB_OTA_UPDATER),true)
94LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
95endif
96
Tao Bao83b07802017-04-26 14:30:56 -070097ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
98LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
99endif
100
David Zeuthen8ed97382017-05-08 13:41:28 -0400101ifeq ($(BOARD_AVB_ENABLE),true)
102LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1
103endif
104
Jed Estep43291862016-02-03 17:02:09 -0800105LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -0700106LOCAL_COMPATIBILITY_SUITE := device-tests
Michael Bestasc86b6d42017-04-28 22:43:09 +0300107LOCAL_C_INCLUDES := $(RECOVERY_PATH)
Jed Estepb8a693b2016-03-09 17:51:34 -0800108LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700109 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -0800110 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -0700111 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -0800112 component/imgdiff_test.cpp \
Tao Bao62e0bc72017-04-10 16:55:57 -0700113 component/install_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -0800114 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -0800115 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700116 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -0700117 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700118 component/verifier_test.cpp
Jed Estep43291862016-02-03 17:02:09 -0800119
Tao Bao102016c2017-08-09 16:33:07 -0700120LOCAL_SHARED_LIBRARIES := \
121 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -0700122
123tune2fs_static_libraries := \
124 libext2_com_err \
125 libext2_blkid \
126 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800127 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700128 libext2_e2p \
129 libext2fs
130
Tao Bao80e46e02015-06-03 10:49:29 -0700131LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700132 libapplypatch_modes \
Dan Albert13f21c22014-10-16 17:39:31 -0700133 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700134 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800135 libimgdiff \
136 libimgpatch \
137 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700138 libbspatch \
Tao Baoed138192017-05-01 22:30:39 -0700139 libfusesideload \
Jed Estep43291862016-02-03 17:02:09 -0800140 libotafault \
Tao Bao62e0bc72017-04-10 16:55:57 -0700141 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700142 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800143 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800144 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700145 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700146 libmounts \
Tao Bao83b07802017-04-26 14:30:56 -0700147 libupdate_verifier \
Tao Bao97555da2016-12-15 10:15:06 -0800148 libdivsufsort \
149 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800150 libfs_mgr \
Tao Bao0c7839a2016-10-10 15:48:37 -0700151 liblog \
Tao Baoda320ac2017-04-10 16:55:57 -0700152 libvintf_recovery \
153 libvintf \
154 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700155 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800156 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800157 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700158 libcrypto_utils \
159 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -0800160 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800161 libziparchive \
162 libutils \
Jed Estep43291862016-02-03 17:02:09 -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 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700171 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800172
Jed Estep43291862016-02-03 17:02:09 -0800173testdata_files := $(call find-subdir-files, testdata/*)
174
Tao Bao4102b282016-11-02 16:17:17 -0700175# The testdata files that will go to $OUT/data/nativetest/recovery.
176testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800177GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
178$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
179$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
180$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
181 $(transform-generated-source)
182LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700183
Tao Bao4102b282016-11-02 16:17:17 -0700184# A copy of the testdata to be packed into continuous_native_tests.zip.
185testdata_continuous_zip_prefix := \
186 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
187testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
188GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
189$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
190$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
191$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700192 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700193LOCAL_GENERATED_SOURCES += $(GEN)
194LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700195
Dan Albert13f21c22014-10-16 17:39:31 -0700196include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800197
198# Host tests
199include $(CLEAR_VARS)
200LOCAL_CFLAGS := -Werror
201LOCAL_MODULE := recovery_host_test
202LOCAL_MODULE_HOST_OS := linux
203LOCAL_C_INCLUDES := bootable/recovery
204LOCAL_SRC_FILES := \
205 component/imgdiff_test.cpp
206LOCAL_STATIC_LIBRARIES := \
207 libimgdiff \
208 libimgpatch \
209 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 \
215 libbz \
216 libdivsufsort64 \
217 libdivsufsort \
218 libz
219LOCAL_SHARED_LIBRARIES := \
220 liblog
221include $(BUILD_HOST_NATIVE_TEST)