blob: 3ab5ea6c2d9e7db24f8e0fa43cd4fe1a85db9d7a [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
23LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xu2430e292016-04-19 15:02:41 -070024LOCAL_STATIC_LIBRARIES := \
25 libverifier \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070026 libminui \
27 libotautil \
28 libziparchive \
29 libutils \
30 libz \
31 libselinux \
32 libbase
Tianjie Xu2430e292016-04-19 15:02:41 -070033
Tao Baoc3292f32016-11-04 10:52:13 -070034LOCAL_SRC_FILES := \
35 unit/asn1_decoder_test.cpp \
Tao Baof19295c2016-12-22 09:28:03 -080036 unit/dirutil_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070037 unit/locale_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070038 unit/sysutil_test.cpp \
Tao Baoe7e7b462016-12-21 17:58:42 -080039 unit/zip_test.cpp \
40 unit/ziputil_test.cpp
Tao Baoc3292f32016-11-04 10:52:13 -070041
Jed Estep43291862016-02-03 17:02:09 -080042LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080043LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080044include $(BUILD_NATIVE_TEST)
45
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080046# Manual tests
47include $(CLEAR_VARS)
48LOCAL_CLANG := true
49LOCAL_CFLAGS := -Werror
50LOCAL_MODULE := recovery_manual_test
51LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xud17a6882017-01-09 11:18:29 -080052LOCAL_STATIC_LIBRARIES := \
53 libminui \
54 libbase
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080055
56LOCAL_SRC_FILES := manual/recovery_test.cpp
Tianjie Xud17a6882017-01-09 11:18:29 -080057LOCAL_SHARED_LIBRARIES := \
58 liblog \
59 libpng
60
61resource_files := $(call find-files-in-subdirs, bootable/recovery, \
62 "*_text.png", \
63 res-mdpi/images \
64 res-hdpi/images \
65 res-xhdpi/images \
66 res-xxhdpi/images \
67 res-xxxhdpi/images \
68 )
69
70# The resource image files that will go to $OUT/data/nativetest/recovery.
71testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
72GEN := $(addprefix $(testimage_out_path)/, $(resource_files))
73
74$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
75$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
76$(GEN): $(testimage_out_path)/% : bootable/recovery/%
77 $(transform-generated-source)
78LOCAL_GENERATED_SOURCES += $(GEN)
79
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080080include $(BUILD_NATIVE_TEST)
81
Jed Estep43291862016-02-03 17:02:09 -080082# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070083include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -070084LOCAL_CFLAGS := -Werror
Dan Albert13f21c22014-10-16 17:39:31 -070085LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jed Estep43291862016-02-03 17:02:09 -080086LOCAL_MODULE := recovery_component_test
87LOCAL_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 Bao10334082016-12-12 17:10:20 -080093 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070094 component/updater_test.cpp \
95 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -080096
Jed Estep43291862016-02-03 17:02:09 -080097LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Bao0c7839a2016-10-10 15:48:37 -070098
99tune2fs_static_libraries := \
100 libext2_com_err \
101 libext2_blkid \
102 libext2_quota \
Alex Deymo7c5dbd62017-01-13 17:32:20 -0800103 libext2_uuid \
Tao Bao0c7839a2016-10-10 15:48:37 -0700104 libext2_e2p \
105 libext2fs
106
Jed Estep43291862016-02-03 17:02:09 -0800107LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -0700108 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -0800109 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -0700110 libedify \
Tao Bao97555da2016-12-15 10:15:06 -0800111 libimgdiff \
112 libimgpatch \
113 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700114 libbspatch \
Jed Estepb8a693b2016-03-09 17:51:34 -0800115 libotafault \
Tao Bao0c7839a2016-10-10 15:48:37 -0700116 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -0800117 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -0800118 libverifier \
Jed Estep43291862016-02-03 17:02:09 -0800119 libminui \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700120 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -0700121 libmounts \
Tao Bao97555da2016-12-15 10:15:06 -0800122 libdivsufsort \
123 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -0800124 libfs_mgr \
Tao Bao0c7839a2016-10-10 15:48:37 -0700125 liblog \
126 libselinux \
Alex Deymo31653662017-01-11 14:02:13 -0800127 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800128 libsparse \
Tao Bao0c7839a2016-10-10 15:48:37 -0700129 libcrypto_utils \
130 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -0800131 libcutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800132 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800133 libziparchive \
134 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800135 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700136 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700137 libtune2fs \
138 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800139
Jed Estep43291862016-02-03 17:02:09 -0800140testdata_files := $(call find-subdir-files, testdata/*)
141
Tao Bao4102b282016-11-02 16:17:17 -0700142# The testdata files that will go to $OUT/data/nativetest/recovery.
143testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800144GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
145$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
146$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
147$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
148 $(transform-generated-source)
149LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700150
Tao Bao4102b282016-11-02 16:17:17 -0700151# A copy of the testdata to be packed into continuous_native_tests.zip.
152testdata_continuous_zip_prefix := \
153 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
154testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
155GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
156$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
157$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
158$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700159 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700160LOCAL_GENERATED_SOURCES += $(GEN)
161LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700162
Dan Albert13f21c22014-10-16 17:39:31 -0700163include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800164
165# Host tests
166include $(CLEAR_VARS)
167LOCAL_CFLAGS := -Werror
168LOCAL_MODULE := recovery_host_test
169LOCAL_MODULE_HOST_OS := linux
170LOCAL_C_INCLUDES := bootable/recovery
171LOCAL_SRC_FILES := \
172 component/imgdiff_test.cpp
173LOCAL_STATIC_LIBRARIES := \
174 libimgdiff \
175 libimgpatch \
176 libbsdiff \
Sen Jiang25c56972016-05-10 15:23:25 -0700177 libbspatch \
Tao Bao97555da2016-12-15 10:15:06 -0800178 libziparchive \
179 libbase \
180 libcrypto \
181 libbz \
182 libdivsufsort64 \
183 libdivsufsort \
184 libz
185LOCAL_SHARED_LIBRARIES := \
186 liblog
187include $(BUILD_HOST_NATIVE_TEST)