blob: ec725d865beb55683b6f7886b9b0197dddba6ced [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 \
36 unit/locale_test.cpp \
Tao Baoc3292f32016-11-04 10:52:13 -070037 unit/sysutil_test.cpp \
38 unit/zip_test.cpp
39
Jed Estep43291862016-02-03 17:02:09 -080040LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080041LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080042include $(BUILD_NATIVE_TEST)
43
Tianjie Xu5d8b53b2016-11-07 14:45:59 -080044# Manual tests
45include $(CLEAR_VARS)
46LOCAL_CLANG := true
47LOCAL_CFLAGS := -Werror
48LOCAL_MODULE := recovery_manual_test
49LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
50LOCAL_STATIC_LIBRARIES := libbase
51
52LOCAL_SRC_FILES := manual/recovery_test.cpp
53LOCAL_SHARED_LIBRARIES := liblog
54include $(BUILD_NATIVE_TEST)
55
Jed Estep43291862016-02-03 17:02:09 -080056# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070057include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -070058LOCAL_CFLAGS := -Werror
Dan Albert13f21c22014-10-16 17:39:31 -070059LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jed Estep43291862016-02-03 17:02:09 -080060LOCAL_MODULE := recovery_component_test
61LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -080062LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -070063 component/applypatch_test.cpp \
Tao Bao8b7301b2016-12-14 15:52:34 -080064 component/bootloader_message_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -070065 component/edify_test.cpp \
Tao Bao97555da2016-12-15 10:15:06 -080066 component/imgdiff_test.cpp \
Tao Bao10334082016-12-12 17:10:20 -080067 component/uncrypt_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070068 component/updater_test.cpp \
69 component/verifier_test.cpp
Tao Bao10334082016-12-12 17:10:20 -080070
Jed Estep43291862016-02-03 17:02:09 -080071LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Bao0c7839a2016-10-10 15:48:37 -070072
73tune2fs_static_libraries := \
74 libext2_com_err \
75 libext2_blkid \
76 libext2_quota \
77 libext2_uuid_static \
78 libext2_e2p \
79 libext2fs
80
Jed Estep43291862016-02-03 17:02:09 -080081LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -070082 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -080083 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -070084 libedify \
Tao Bao97555da2016-12-15 10:15:06 -080085 libimgdiff \
86 libimgpatch \
87 libbsdiff \
Jed Estepb8a693b2016-03-09 17:51:34 -080088 libotafault \
Tao Bao0c7839a2016-10-10 15:48:37 -070089 libupdater \
Tao Baobedf5fc2016-11-18 12:01:26 -080090 libbootloader_message \
Jed Estep43291862016-02-03 17:02:09 -080091 libverifier \
Jed Estep43291862016-02-03 17:02:09 -080092 libminui \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070093 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -070094 libmounts \
Tao Bao97555da2016-12-15 10:15:06 -080095 libdivsufsort \
96 libdivsufsort64 \
Tao Baobedf5fc2016-11-18 12:01:26 -080097 libfs_mgr \
Tao Bao0c7839a2016-10-10 15:48:37 -070098 liblog \
99 libselinux \
100 libext4_utils_static \
101 libsparse_static \
102 libcrypto_utils \
103 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -0800104 libcutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800105 libbz \
Tao Baoef0eb3b2016-11-14 21:29:52 -0800106 libziparchive \
107 libutils \
Jed Estepb8a693b2016-03-09 17:51:34 -0800108 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -0700109 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -0700110 libtune2fs \
111 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -0800112
Jed Estep43291862016-02-03 17:02:09 -0800113testdata_files := $(call find-subdir-files, testdata/*)
114
Tao Bao4102b282016-11-02 16:17:17 -0700115# The testdata files that will go to $OUT/data/nativetest/recovery.
116testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -0800117GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
118$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
119$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
120$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
121 $(transform-generated-source)
122LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -0700123
Tao Bao4102b282016-11-02 16:17:17 -0700124# A copy of the testdata to be packed into continuous_native_tests.zip.
125testdata_continuous_zip_prefix := \
126 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
127testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
128GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
129$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
130$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
131$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700132 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700133LOCAL_GENERATED_SOURCES += $(GEN)
134LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700135
Dan Albert13f21c22014-10-16 17:39:31 -0700136include $(BUILD_NATIVE_TEST)
Tao Bao97555da2016-12-15 10:15:06 -0800137
138# Host tests
139include $(CLEAR_VARS)
140LOCAL_CFLAGS := -Werror
141LOCAL_MODULE := recovery_host_test
142LOCAL_MODULE_HOST_OS := linux
143LOCAL_C_INCLUDES := bootable/recovery
144LOCAL_SRC_FILES := \
145 component/imgdiff_test.cpp
146LOCAL_STATIC_LIBRARIES := \
147 libimgdiff \
148 libimgpatch \
149 libbsdiff \
150 libziparchive \
151 libbase \
152 libcrypto \
153 libbz \
154 libdivsufsort64 \
155 libdivsufsort \
156 libz
157LOCAL_SHARED_LIBRARIES := \
158 liblog
159include $(BUILD_HOST_NATIVE_TEST)