blob: efe46b8ee306490e8c3026bf8872b4deac892f44 [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 \
Tao Bao6cd81682018-05-03 21:53:11 -070030 libpng \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070031 libziparchive \
32 libutils \
33 libz \
34 libselinux \
Tianjie Xua88cc542017-10-25 13:16:54 -070035 libbase \
36 libBionicGtestMain
Tianjie Xu2430e292016-04-19 15:02:41 -070037
Tao Baoc3292f32016-11-04 10:52:13 -070038LOCAL_SRC_FILES := \
39 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080040 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070041 unit/locale_test.cpp \
Tao Bao8f237572017-03-26 13:36:49 -070042 unit/rangeset_test.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070043 unit/screen_ui_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070044 unit/sysutil_test.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070045 unit/zip_test.cpp
Tao Baoc3292f32016-11-04 10:52:13 -070046
Jed Estep43291862016-02-03 17:02:09 -080047LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080048LOCAL_SHARED_LIBRARIES := liblog
Tao Bao9d91e892018-03-30 20:43:45 -070049LOCAL_TEST_DATA := \
50 $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata)
Jed Estep43291862016-02-03 17:02:09 -080051include $(BUILD_NATIVE_TEST)
52
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080053# Manual tests
54include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070055LOCAL_CFLAGS := -Wall -Werror
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080056LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080057LOCAL_STATIC_LIBRARIES := \
Tianjie Xua88cc542017-10-25 13:16:54 -070058 libbase \
59 libBionicGtestMain
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 := \
Tao Bao6b28f052018-04-13 13:41:58 -070063 liblog
Tianjie Xud17a6882017-01-09 11:18:29 -080064
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080065include $(BUILD_NATIVE_TEST)
66
Jed Estep43291862016-02-03 17:02:09 -080067# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070068include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070069LOCAL_CFLAGS := \
Tianjie Xuc89d1e72017-08-28 14:15:07 -070070 -Wall \
Tianjie Xu56ebe622017-03-16 00:48:21 -070071 -Werror \
72 -D_FILE_OFFSET_BITS=64
73
Tao Baobc4b1fe2017-04-17 16:46:05 -070074ifeq ($(AB_OTA_UPDATER),true)
75LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
76endif
77
Jed Estep43291862016-02-03 17:02:09 -080078LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -070079LOCAL_COMPATIBILITY_SUITE := device-tests
Jed Estep43291862016-02-03 17:02:09 -080080LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -080081LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -070082 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -080083 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -070084 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -080085 component/imgdiff_test.cpp \
Tao Bao1d866052017-04-10 16:55:57 -070086 component/install_test.cpp \
Tao Bao6b28f052018-04-13 13:41:58 -070087 component/resources_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -080088 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -080089 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070090 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -070091 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070092 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -080093
Tao Bao3e2345e2017-08-09 16:33:07 -070094LOCAL_SHARED_LIBRARIES := \
95 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -070096
Tao Bao9e309972018-05-11 15:13:10 -070097# libapplypatch, libapplypatch_modes, libimgdiff, libimgpatch.
98libapplypatch_static_libraries := \
99 libapplypatch_modes \
100 libapplypatch \
101 libedify \
102 libimgdiff \
103 libimgpatch \
104 libotafault \
105 libotautil \
106 libbsdiff \
107 libbspatch \
108 libdivsufsort \
109 libdivsufsort64 \
110 libutils \
111 libbase \
112 libbz \
113 libcrypto \
114 libz \
115 libziparchive \
116
Tao Bao0c7839a2016-10-10 15:48:37 -0700117tune2fs_static_libraries := \
118 libext2_com_err \
119 libext2_blkid \
120 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800121 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700122 libext2_e2p \
123 libext2fs
124
Tao Bao9e309972018-05-11 15:13:10 -0700125libupdater_static_libraries := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700126 libupdater \
Tao Bao9e309972018-05-11 15:13:10 -0700127 libapplypatch \
128 libbspatch \
129 libedify \
130 libziparchive \
131 libotautil \
Tao Baobedf5fc2016-11-18 12:01:26 -0800132 libbootloader_message \
Tao Bao9e309972018-05-11 15:13:10 -0700133 libutils \
134 libotafault \
135 libext4_utils \
136 libfec \
137 libfec_rs \
138 libfs_mgr \
139 liblog \
140 libselinux \
141 libsparse \
142 libsquashfs_utils \
143 libbz \
144 libz \
145 libbase \
146 libcrypto \
147 libcrypto_utils \
148 libcutils \
149 libtune2fs \
150 libbrotli \
151 $(tune2fs_static_libraries)
152
Tao Baofd0ace82017-10-11 20:25:36 -0700153health_hal_static_libraries := \
154 android.hardware.health@2.0-impl \
155 android.hardware.health@2.0 \
156 android.hardware.health@1.0 \
157 android.hardware.health@1.0-convert \
158 libhealthstoragedefault \
159 libhidltransport \
160 libhidlbase \
161 libhwbinder_noltopgo \
162 libvndksupport \
163 libbatterymonitor
164
Tao Bao9e309972018-05-11 15:13:10 -0700165librecovery_static_libraries := \
166 librecovery \
167 $(TARGET_RECOVERY_UI_LIB) \
168 libbootloader_message \
169 libfusesideload \
170 libminadbd \
171 librecovery_ui \
172 libminui \
Jed Estep43291862016-02-03 17:02:09 -0800173 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700174 libotautil \
Tao Baofd0ace82017-10-11 20:25:36 -0700175 $(health_hal_static_libraries) \
Tao Bao9e309972018-05-11 15:13:10 -0700176 libasyncio \
Tao Bao9e309972018-05-11 15:13:10 -0700177 libcrypto_utils \
178 libcrypto \
179 libext4_utils \
Tao Baobedf5fc2016-11-18 12:01:26 -0800180 libfs_mgr \
Tao Bao6b28f052018-04-13 13:41:58 -0700181 libpng \
Tao Bao9e309972018-05-11 15:13:10 -0700182 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -0700183 libvintf_recovery \
184 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800185 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700186 libtinyxml2 \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800187 libziparchive \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700188 libbase \
Tao Bao9e309972018-05-11 15:13:10 -0700189 libutils \
Tao Baofd0ace82017-10-11 20:25:36 -0700190 libcutils \
Tao Bao9e309972018-05-11 15:13:10 -0700191 liblog \
192 libselinux \
193 libz \
194
195libupdate_verifier_static_libraries := \
196 libupdate_verifier \
197
198LOCAL_STATIC_LIBRARIES := \
199 $(libapplypatch_static_libraries) \
200 $(librecovery_static_libraries) \
201 $(libupdate_verifier_static_libraries) \
202 $(libupdater_static_libraries) \
203 libBionicGtestMain
Jed Estep43291862016-02-03 17:02:09 -0800204
Tao Bao9d91e892018-03-30 20:43:45 -0700205LOCAL_TEST_DATA := \
Tao Bao6b28f052018-04-13 13:41:58 -0700206 $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata) \
207 $(call find-test-data-in-subdirs, bootable/recovery, "*_text.png", res-*)
Dan Albert13f21c22014-10-16 17:39:31 -0700208include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800209
210# Host tests
211include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700212LOCAL_CFLAGS := -Wall -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800213LOCAL_MODULE := recovery_host_test
214LOCAL_MODULE_HOST_OS := linux
215LOCAL_C_INCLUDES := bootable/recovery
216LOCAL_SRC_FILES := \
217 component/imgdiff_test.cpp
218LOCAL_STATIC_LIBRARIES := \
219 libimgdiff \
220 libimgpatch \
Tao Bao09e468f2017-09-29 14:39:33 -0700221 libotautil \
Tao Bao97555da2016-12-15 10:15:06 -0800222 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700223 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800224 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800225 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800226 libbase \
227 libcrypto \
Tianjie Xu8c280812017-10-28 22:13:16 -0700228 libbrotli \
Tao Bao97555da2016-12-15 10:15:06 -0800229 libbz \
230 libdivsufsort64 \
231 libdivsufsort \
Tianjie Xua88cc542017-10-25 13:16:54 -0700232 libz \
233 libBionicGtestMain
Tao Bao97555da2016-12-15 10:15:06 -0800234LOCAL_SHARED_LIBRARIES := \
235 liblog
Tao Bao9d91e892018-03-30 20:43:45 -0700236LOCAL_TEST_DATA := \
237 $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata)
Tao Bao97555da2016-12-15 10:15:06 -0800238include $(BUILD_HOST_NATIVE_TEST)