blob: e4f252127c6daaf64c2471b297b3ce543bb912b5 [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
29LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xu2430e292016-04-19 15:02:41 -070030LOCAL_STATIC_LIBRARIES := \
31 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070032 libminui \
33 libotautil \
34 libziparchive \
35 libutils \
36 libz \
37 libselinux \
38 libbase
Tianjie Xu2430e292016-04-19 15:02:41 -070039
Tao Baoc3292f32016-11-04 10:52:13 -070040LOCAL_SRC_FILES := \
41 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080042 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070043 unit/locale_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070044 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080045 unit/zip_test.cpp \
46 unit/ziputil_test.cpp
Tao Baoc3292f32016-11-04 10:52:13 -070047
Michael Bestasc86b6d42017-04-28 22:43:09 +030048LOCAL_C_INCLUDES := $(RECOVERY_PATH)
Mark Salyzyn13aca592016-03-09 14:58:16 -080049LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080050include $(BUILD_NATIVE_TEST)
51
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080052# Manual tests
Kenny Root7a4adb52013-10-09 10:14:35 -070053include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -070054LOCAL_CLANG := true
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080055LOCAL_CFLAGS := -Werror
56LOCAL_MODULE := recovery_manual_test
Dan Albert13f21c22014-10-16 17:39:31 -070057LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xud17a6882017-01-09 11:18:29 -080058LOCAL_STATIC_LIBRARIES := \
59 libminui \
60 libbase
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080061
62LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080063LOCAL_SHARED_LIBRARIES := \
64 liblog \
65 libpng
66
67resource_files := $(call find-files-in-subdirs, bootable/recovery, \
68 "*_text.png", \
69 res-mdpi/images \
70 res-hdpi/images \
71 res-xhdpi/images \
72 res-xxhdpi/images \
73 res-xxxhdpi/images \
74 )
75
76# The resource image files that will go to $OUT/data/nativetest/recovery.
77testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
78GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
79
80$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
81$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
82$(GEN): $(testimage_out_path)/% : bootable/recovery/%
83 $(transform-generated-source)
84LOCAL_GENERATED_SOURCES += $(GEN)
85
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080086include $(BUILD_NATIVE_TEST)
87
Kenny Root7a4adb52013-10-09 10:14:35 -070088# Component tests
89include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070090LOCAL_CFLAGS := \
91 -Werror \
92 -D_FILE_OFFSET_BITS=64
93
Dan Albert13f21c22014-10-16 17:39:31 -070094LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tao Baoa233a892017-04-17 16:46:05 -070095
96ifeq ($(AB_OTA_UPDATER),true)
97LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
98endif
99
Jed Estep43291862016-02-03 17:02:09 -0800100LOCAL_MODULE := recovery_component_test
Michael Bestasc86b6d42017-04-28 22:43:09 +0300101LOCAL_C_INCLUDES := $(RECOVERY_PATH)
Jed Estepb8a693b2016-03-09 17:51:34 -0800102LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -0700103 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -0800104 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -0700105 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -0800106 component/imgdiff_test.cpp \
Tao Bao62e0bc72017-04-10 16:55:57 -0700107 component/install_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -0800108 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -0800109 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700110 component/updater_test.cpp \
111 component/verifier_test.cpp
Jed Estep43291862016-02-03 17:02:09 -0800112
Kenny Root7a4adb52013-10-09 10:14:35 -0700113LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Bao0c7839a2016-10-10 15:48:37 -0700114
115tune2fs_static_libraries := \
116 libext2_com_err \
117 libext2_blkid \
118 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800119 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700120 libext2_e2p \
121 libext2fs
122
Dan Albert13f21c22014-10-16 17:39:31 -0700123LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700124 libapplypatch_modes \
Dan Albert13f21c22014-10-16 17:39:31 -0700125 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700126 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800127 libimgdiff \
128 libimgpatch \
129 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700130 libbspatch \
Jed Estep43291862016-02-03 17:02:09 -0800131 libotafault \
Tao Bao62e0bc72017-04-10 16:55:57 -0700132 librecovery \
Tao Bao0c7839a2016-10-10 15:48:37 -0700133 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800134 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800135 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700136 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700137 libmounts \
Tao Bao97555da2016-12-15 10:15:06 -0800138 libdivsufsort \
139 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800140 libfs_mgr \
Tao Bao0c7839a2016-10-10 15:48:37 -0700141 liblog \
Tao Baoda320ac2017-04-10 16:55:57 -0700142 libvintf_recovery \
143 libvintf \
144 libtinyxml2 \
Tao Bao0c7839a2016-10-10 15:48:37 -0700145 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800146 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800147 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700148 libcrypto_utils \
149 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -0800150 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800151 libziparchive \
152 libutils \
Jed Estep43291862016-02-03 17:02:09 -0800153 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700154 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700155 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700156 libfec \
157 libfec_rs \
158 libsquashfs_utils \
159 libcutils \
Tao Bao0c7839a2016-10-10 15:48:37 -0700160 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800161
Jed Estep43291862016-02-03 17:02:09 -0800162testdata_files := $(call find-subdir-files, testdata/*)
163
Tao Bao4102b282016-11-02 16:17:17 -0700164# The testdata files that will go to $OUT/data/nativetest/recovery.
165testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800166GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
167$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
168$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
169$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
170 $(transform-generated-source)
171LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700172
Tao Bao4102b282016-11-02 16:17:17 -0700173# A copy of the testdata to be packed into continuous_native_tests.zip.
174testdata_continuous_zip_prefix := \
175 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
176testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
177GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
178$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
179$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
180$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700181 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700182LOCAL_GENERATED_SOURCES += $(GEN)
183LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700184
Dan Albert13f21c22014-10-16 17:39:31 -0700185include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800186
187# Host tests
188include $(CLEAR_VARS)
189LOCAL_CFLAGS := -Werror
190LOCAL_MODULE := recovery_host_test
191LOCAL_MODULE_HOST_OS := linux
192LOCAL_C_INCLUDES := bootable/recovery
193LOCAL_SRC_FILES := \
194 component/imgdiff_test.cpp
195LOCAL_STATIC_LIBRARIES := \
196 libimgdiff \
197 libimgpatch \
198 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700199 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800200 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800201 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800202 libbase \
203 libcrypto \
204 libbz \
205 libdivsufsort64 \
206 libdivsufsort \
207 libz
208LOCAL_SHARED_LIBRARIES := \
209 liblog
210include $(BUILD_HOST_NATIVE_TEST)