blob: b29ff50f6ea682cbf04aae703c4c132338fe492a [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
Tao Bao9d91e892018-03-30 20:43:45 -070048LOCAL_TEST_DATA := \
49 $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata)
Jed Estep43291862016-02-03 17:02:09 -080050include $(BUILD_NATIVE_TEST)
51
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080052# Manual tests
53include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070054LOCAL_CFLAGS := -Wall -Werror
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080055LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080056LOCAL_STATIC_LIBRARIES := \
Tianjie Xua88cc542017-10-25 13:16:54 -070057 libbase \
58 libBionicGtestMain
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080059
60LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080061LOCAL_SHARED_LIBRARIES := \
Tao Bao6b28f052018-04-13 13:41:58 -070062 liblog
Tianjie Xud17a6882017-01-09 11:18:29 -080063
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080064include $(BUILD_NATIVE_TEST)
65
Jed Estep43291862016-02-03 17:02:09 -080066# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070067include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070068LOCAL_CFLAGS := \
Tianjie Xuc89d1e72017-08-28 14:15:07 -070069 -Wall \
Tianjie Xu56ebe622017-03-16 00:48:21 -070070 -Werror \
71 -D_FILE_OFFSET_BITS=64
72
Tao Baobc4b1fe2017-04-17 16:46:05 -070073ifeq ($(AB_OTA_UPDATER),true)
74LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
75endif
76
Tao Bao83b07802017-04-26 14:30:56 -070077ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
78LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
79endif
80
David Zeuthen8ed97382017-05-08 13:41:28 -040081ifeq ($(BOARD_AVB_ENABLE),true)
82LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1
83endif
84
Jed Estep43291862016-02-03 17:02:09 -080085LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -070086LOCAL_COMPATIBILITY_SUITE := device-tests
Jed Estep43291862016-02-03 17:02:09 -080087LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -080088LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -070089 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -080090 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -070091 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -080092 component/imgdiff_test.cpp \
Tao Bao1d866052017-04-10 16:55:57 -070093 component/install_test.cpp \
Tao Bao6b28f052018-04-13 13:41:58 -070094 component/resources_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -080095 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -080096 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070097 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -070098 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070099 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -0800100
Tao Bao3e2345e2017-08-09 16:33:07 -0700101LOCAL_SHARED_LIBRARIES := \
102 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -0700103
104tune2fs_static_libraries := \
105 libext2_com_err \
106 libext2_blkid \
107 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800108 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700109 libext2_e2p \
110 libext2fs
111
Jed Estep43291862016-02-03 17:02:09 -0800112LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700113 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -0800114 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700115 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800116 libimgdiff \
117 libimgpatch \
118 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700119 libbspatch \
Tao Baoed138192017-05-01 22:30:39 -0700120 libfusesideload \
Tao Bao6b28f052018-04-13 13:41:58 -0700121 libminui \
Jed Estepb8a693b2016-03-09 17:51:34 -0800122 libotafault \
Tao Bao1d866052017-04-10 16:55:57 -0700123 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700124 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800125 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800126 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700127 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700128 libmounts \
Tao Bao83b07802017-04-26 14:30:56 -0700129 libupdate_verifier \
Tao Bao97555da2016-12-15 10:15:06 -0800130 libdivsufsort \
131 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800132 libfs_mgr \
Tao Bao6b28f052018-04-13 13:41:58 -0700133 libpng \
Tao Bao919d2c92017-04-10 16:55:57 -0700134 libvintf_recovery \
135 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800136 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700137 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700138 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800139 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800140 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700141 libcrypto_utils \
142 libcrypto \
Jed Estepb8a693b2016-03-09 17:51:34 -0800143 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800144 libziparchive \
Tao Bao646b05a2017-09-28 17:43:53 -0700145 liblog \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800146 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800147 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700148 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700149 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700150 libfec \
151 libfec_rs \
152 libsquashfs_utils \
153 libcutils \
Tianjie Xu107a34f2017-06-29 17:04:21 -0700154 libbrotli \
Tianjie Xua88cc542017-10-25 13:16:54 -0700155 libBionicGtestMain \
Tao Bao0c7839a2016-10-10 15:48:37 -0700156 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800157
Tao Bao9d91e892018-03-30 20:43:45 -0700158LOCAL_TEST_DATA := \
Tao Bao6b28f052018-04-13 13:41:58 -0700159 $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata) \
160 $(call find-test-data-in-subdirs, bootable/recovery, "*_text.png", res-*)
Dan Albert13f21c22014-10-16 17:39:31 -0700161include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800162
163# Host tests
164include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700165LOCAL_CFLAGS := -Wall -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800166LOCAL_MODULE := recovery_host_test
167LOCAL_MODULE_HOST_OS := linux
168LOCAL_C_INCLUDES := bootable/recovery
169LOCAL_SRC_FILES := \
170 component/imgdiff_test.cpp
171LOCAL_STATIC_LIBRARIES := \
172 libimgdiff \
173 libimgpatch \
Tao Bao09e468f2017-09-29 14:39:33 -0700174 libotautil \
Tao Bao97555da2016-12-15 10:15:06 -0800175 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700176 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800177 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800178 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800179 libbase \
180 libcrypto \
Tianjie Xu8c280812017-10-28 22:13:16 -0700181 libbrotli \
Tao Bao97555da2016-12-15 10:15:06 -0800182 libbz \
183 libdivsufsort64 \
184 libdivsufsort \
Tianjie Xua88cc542017-10-25 13:16:54 -0700185 libz \
186 libBionicGtestMain
Tao Bao97555da2016-12-15 10:15:06 -0800187LOCAL_SHARED_LIBRARIES := \
188 liblog
Tao Bao9d91e892018-03-30 20:43:45 -0700189LOCAL_TEST_DATA := \
190 $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata)
Tao Bao97555da2016-12-15 10:15:06 -0800191include $(BUILD_HOST_NATIVE_TEST)