blob: a8f1d78742ab16ac929dc5c156717c298cc18e28 [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 Xu7aa88742016-09-28 11:42:17 -070021LOCAL_CFLAGS := -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
Jed Estep43291862016-02-03 17:02:09 -080024LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xu2430e292016-04-19 15:02:41 -070025LOCAL_STATIC_LIBRARIES := \
26 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070027 libminui \
28 libotautil \
29 libziparchive \
30 libutils \
31 libz \
32 libselinux \
33 libbase
Tianjie Xu2430e292016-04-19 15:02:41 -070034
Tao Baoc3292f32016-11-04 10:52:13 -070035LOCAL_SRC_FILES := \
36 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080037 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070038 unit/locale_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070039 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080040 unit/zip_test.cpp \
41 unit/ziputil_test.cpp
Tao Baoc3292f32016-11-04 10:52:13 -070042
Jed Estep43291862016-02-03 17:02:09 -080043LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080044LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080045include $(BUILD_NATIVE_TEST)
46
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080047# Manual tests
48include $(CLEAR_VARS)
49LOCAL_CLANG := true
50LOCAL_CFLAGS := -Werror
51LOCAL_MODULE := recovery_manual_test
52LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xud17a6882017-01-09 11:18:29 -080053LOCAL_STATIC_LIBRARIES := \
54 libminui \
55 libbase
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080056
57LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080058LOCAL_SHARED_LIBRARIES := \
59 liblog \
60 libpng
61
62resource_files := $(call find-files-in-subdirs, bootable/recovery, \
63 "*_text.png", \
64 res-mdpi/images \
65 res-hdpi/images \
66 res-xhdpi/images \
67 res-xxhdpi/images \
68 res-xxxhdpi/images \
69 )
70
71# The resource image files that will go to $OUT/data/nativetest/recovery.
72testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
73GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
74
75$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
76$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
77$(GEN): $(testimage_out_path)/% : bootable/recovery/%
78 $(transform-generated-source)
79LOCAL_GENERATED_SOURCES += $(GEN)
80
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080081include $(BUILD_NATIVE_TEST)
82
Jed Estep43291862016-02-03 17:02:09 -080083# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070084include $(CLEAR_VARS)
Tianjie Xu56ebe622017-03-16 00:48:21 -070085LOCAL_CFLAGS := \
86 -Werror \
87 -D_FILE_OFFSET_BITS=64
88
Dan Albert13f21c22014-10-16 17:39:31 -070089LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jed Estep43291862016-02-03 17:02:09 -080090LOCAL_MODULE := recovery_component_test
Dan Shi73683162017-03-28 17:22:41 -070091LOCAL_COMPATIBILITY_SUITE := device-tests
Jed Estep43291862016-02-03 17:02:09 -080092LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -080093LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -070094 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -080095 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -070096 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -080097 component/imgdiff_test.cpp \
Wei Wangb72a15a2017-03-02 13:46:37 -080098 component/sideload_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -080099 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -0700100 component/updater_test.cpp \
101 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -0800102
Jed Estep43291862016-02-03 17:02:09 -0800103LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Bao0c7839a2016-10-10 15:48:37 -0700104
105tune2fs_static_libraries := \
106 libext2_com_err \
107 libext2_blkid \
108 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800109 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700110 libext2_e2p \
111 libext2fs
112
Jed Estep43291862016-02-03 17:02:09 -0800113LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700114 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -0800115 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700116 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800117 libimgdiff \
118 libimgpatch \
119 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700120 libbspatch \
Jed Estepb8a693b2016-03-09 17:51:34 -0800121 libotafault \
Tao Bao0c7839a2016-10-10 15:48:37 -0700122 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800123 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800124 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700125 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700126 libmounts \
Tao Bao97555da2016-12-15 10:15:06 -0800127 libdivsufsort \
128 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800129 libfs_mgr \
Tao Bao0c7839a2016-10-10 15:48:37 -0700130 liblog \
131 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800132 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800133 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700134 libcrypto_utils \
135 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -0800136 libcutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800137 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800138 libziparchive \
139 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800140 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700141 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700142 libtune2fs \
Tianjie Xu56ebe622017-03-16 00:48:21 -0700143 libfec \
144 libfec_rs \
145 libsquashfs_utils \
146 libcutils \
Tao Bao0c7839a2016-10-10 15:48:37 -0700147 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800148
Jed Estep43291862016-02-03 17:02:09 -0800149testdata_files := $(call find-subdir-files, testdata/*)
150
Tao Bao4102b282016-11-02 16:17:17 -0700151# The testdata files that will go to $OUT/data/nativetest/recovery.
152testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800153GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
154$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
155$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
156$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
157 $(transform-generated-source)
158LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700159
Tao Bao4102b282016-11-02 16:17:17 -0700160# A copy of the testdata to be packed into continuous_native_tests.zip.
161testdata_continuous_zip_prefix := \
162 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
163testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
164GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
165$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
166$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
167$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700168 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700169LOCAL_GENERATED_SOURCES += $(GEN)
170LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700171
Dan Albert13f21c22014-10-16 17:39:31 -0700172include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800173
174# Host tests
175include $(CLEAR_VARS)
176LOCAL_CFLAGS := -Werror
177LOCAL_MODULE := recovery_host_test
178LOCAL_MODULE_HOST_OS := linux
179LOCAL_C_INCLUDES := bootable/recovery
180LOCAL_SRC_FILES := \
181 component/imgdiff_test.cpp
182LOCAL_STATIC_LIBRARIES := \
183 libimgdiff \
184 libimgpatch \
185 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700186 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800187 libziparchive \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800188 libutils \
Tao Bao97555da2016-12-15 10:15:06 -0800189 libbase \
190 libcrypto \
191 libbz \
192 libdivsufsort64 \
193 libdivsufsort \
194 libz
195LOCAL_SHARED_LIBRARIES := \
196 liblog
197include $(BUILD_HOST_NATIVE_TEST)