blob: f19ca36c07cb6f4e4e4142e1fdf7a08a32ace3d2 [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 \
Tianjie Xua88cc542017-10-25 13:16:54 -070033 libbase \
34 libBionicGtestMain
Tianjie Xu2430e292016-04-19 15:02:41 -070035
Tao Baoc3292f32016-11-04 10:52:13 -070036LOCAL_SRC_FILES := \
37 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080038 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070039 unit/locale_test.cpp \
Tao Bao8f237572017-03-26 13:36:49 -070040 unit/rangeset_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070041 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080042 unit/zip_test.cpp \
Tom Marshall981118e2017-10-25 20:27:08 +020043 unit/ziputil_test.cpp
Tao Baoc3292f32016-11-04 10:52:13 -070044
Michael Bestas43ee7e72018-01-10 18:33:42 +020045LOCAL_C_INCLUDES := $(commands_recovery_local_path)
Mark Salyzyn13aca592016-03-09 14:58:16 -080046LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080047include $(BUILD_NATIVE_TEST)
48
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080049# Manual tests
Kenny Root7a4adb52013-10-09 10:14:35 -070050include $(CLEAR_VARS)
Tianjie Xuc89d1e72017-08-28 14:15:07 -070051LOCAL_CFLAGS := -Wall -Werror
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080052LOCAL_MODULE := recovery_manual_test
Tianjie Xud17a6882017-01-09 11:18:29 -080053LOCAL_STATIC_LIBRARIES := \
54 libminui \
Tianjie Xua88cc542017-10-25 13:16:54 -070055 libbase \
56 libBionicGtestMain
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080057
58LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080059LOCAL_SHARED_LIBRARIES := \
60 liblog \
61 libpng
62
63resource_files := $(call find-files-in-subdirs, bootable/recovery, \
64 "*_text.png", \
65 res-mdpi/images \
66 res-hdpi/images \
67 res-xhdpi/images \
68 res-xxhdpi/images \
69 res-xxxhdpi/images \
70 )
71
72# The resource image files that will go to $OUT/data/nativetest/recovery.
73testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
74GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
75
76$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
77$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
78$(GEN): $(testimage_out_path)/% : bootable/recovery/%
79 $(transform-generated-source)
80LOCAL_GENERATED_SOURCES += $(GEN)
81
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080082include $(BUILD_NATIVE_TEST)
83
Kenny Root7a4adb52013-10-09 10:14:35 -070084# Component tests
85include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070086LOCAL_CFLAGS := \
Tianjie Xuc89d1e72017-08-28 14:15:07 -070087 -Wall \
Tianjie Xu56ebe622017-03-16 00:48:21 -070088 -Werror \
89 -D_FILE_OFFSET_BITS=64
90
Tao Baoa233a892017-04-17 16:46:05 -070091ifeq ($(AB_OTA_UPDATER),true)
92LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
93endif
94
Tao Bao83b07802017-04-26 14:30:56 -070095ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
96LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
97endif
98
David Zeuthen8ed97382017-05-08 13:41:28 -040099ifeq ($(BOARD_AVB_ENABLE),true)
100LOCAL_CFLAGS += -DBOARD_AVB_ENABLE=1
101endif
102
Jed Estep43291862016-02-03 17:02:09 -0800103LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -0700104LOCAL_COMPATIBILITY_SUITE := device-tests
Michael Bestas43ee7e72018-01-10 18:33:42 +0200105LOCAL_C_INCLUDES := $(commands_recovery_local_path)
Jed Estepb8a693b2016-03-09 17:51:34 -0800106LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700107 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -0800108 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -0700109 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -0800110 component/imgdiff_test.cpp \
Tao Bao62e0bc72017-04-10 16:55:57 -0700111 component/install_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -0800112 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -0800113 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700114 component/updater_test.cpp \
Tao Bao83b07802017-04-26 14:30:56 -0700115 component/update_verifier_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700116 component/verifier_test.cpp
Jed Estep43291862016-02-03 17:02:09 -0800117
Tao Bao102016c2017-08-09 16:33:07 -0700118LOCAL_SHARED_LIBRARIES := \
119 libhidlbase
Tao Bao0c7839a2016-10-10 15:48:37 -0700120
121tune2fs_static_libraries := \
122 libext2_com_err \
123 libext2_blkid \
124 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800125 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700126 libext2_e2p \
127 libext2fs
128
Tao Bao80e46e02015-06-03 10:49:29 -0700129LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700130 libapplypatch_modes \
Dan Albert13f21c22014-10-16 17:39:31 -0700131 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700132 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800133 libimgdiff \
134 libimgpatch \
135 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700136 libbspatch \
Tao Baoed138192017-05-01 22:30:39 -0700137 libfusesideload \
Jed Estep43291862016-02-03 17:02:09 -0800138 libotafault \
Tao Bao62e0bc72017-04-10 16:55:57 -0700139 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700140 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800141 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800142 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700143 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700144 libmounts \
Tao Bao83b07802017-04-26 14:30:56 -0700145 libupdate_verifier \
Tao Bao97555da2016-12-15 10:15:06 -0800146 libdivsufsort \
147 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800148 libfs_mgr \
Tao Baoda320ac2017-04-10 16:55:57 -0700149 libvintf_recovery \
150 libvintf \
Yifan Hong91b48f92018-03-06 17:59:58 -0800151 libhidl-gen-utils \
Tao Baoda320ac2017-04-10 16:55:57 -0700152 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700153 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800154 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800155 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700156 libcrypto_utils \
157 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -0800158 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800159 libziparchive \
Tao Bao646b05a2017-09-28 17:43:53 -0700160 liblog \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800161 libutils \
Jed Estep43291862016-02-03 17:02:09 -0800162 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700163 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700164 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700165 libfec \
166 libfec_rs \
167 libsquashfs_utils \
168 libcutils \
Tianjie Xu107a34f2017-06-29 17:04:21 -0700169 libbrotli \
Tianjie Xua88cc542017-10-25 13:16:54 -0700170 libBionicGtestMain \
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)
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700200LOCAL_CFLAGS := -Wall -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800201LOCAL_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 \
Tao Bao09e468f2017-09-29 14:39:33 -0700209 libotautil \
Tao Bao97555da2016-12-15 10:15:06 -0800210 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700211 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800212 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800213 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800214 libbase \
215 libcrypto \
Tianjie Xu8c280812017-10-28 22:13:16 -0700216 libbrotli \
Tao Bao97555da2016-12-15 10:15:06 -0800217 libbz \
218 libdivsufsort64 \
219 libdivsufsort \
Tianjie Xua88cc542017-10-25 13:16:54 -0700220 libz \
221 libBionicGtestMain
Tao Bao97555da2016-12-15 10:15:06 -0800222LOCAL_SHARED_LIBRARIES := \
223 liblog
224include $(BUILD_HOST_NATIVE_TEST)