blob: 86591f71d3fdca52851eb9c20fbd184fe4787087 [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 \
37 unit/recovery_test.cpp \
38 unit/sysutil_test.cpp \
39 unit/zip_test.cpp
40
Jed Estep43291862016-02-03 17:02:09 -080041LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080042LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080043include $(BUILD_NATIVE_TEST)
44
45# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070046include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -070047LOCAL_CFLAGS := -Werror
Dan Albert13f21c22014-10-16 17:39:31 -070048LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jed Estep43291862016-02-03 17:02:09 -080049LOCAL_MODULE := recovery_component_test
50LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -080051LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -070052 component/applypatch_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -070053 component/edify_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070054 component/updater_test.cpp \
55 component/verifier_test.cpp
Jed Estep43291862016-02-03 17:02:09 -080056LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Bao0c7839a2016-10-10 15:48:37 -070057
58tune2fs_static_libraries := \
59 libext2_com_err \
60 libext2_blkid \
61 libext2_quota \
62 libext2_uuid_static \
63 libext2_e2p \
64 libext2fs
65
Jed Estep43291862016-02-03 17:02:09 -080066LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -070067 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -080068 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -070069 libedify \
Jed Estepb8a693b2016-03-09 17:51:34 -080070 libotafault \
Tao Bao0c7839a2016-10-10 15:48:37 -070071 libupdater \
Jed Estep43291862016-02-03 17:02:09 -080072 libverifier \
Jed Estep43291862016-02-03 17:02:09 -080073 libminui \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070074 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -070075 libmounts \
76 liblog \
77 libselinux \
78 libext4_utils_static \
79 libsparse_static \
80 libcrypto_utils \
81 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -080082 libcutils \
Jed Estepb8a693b2016-03-09 17:51:34 -080083 libbz \
84 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -070085 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -070086 libtune2fs \
87 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -080088
Jed Estep43291862016-02-03 17:02:09 -080089testdata_files := $(call find-subdir-files, testdata/*)
90
Tao Bao4102b282016-11-02 16:17:17 -070091# The testdata files that will go to $OUT/data/nativetest/recovery.
92testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery
Jed Estep43291862016-02-03 17:02:09 -080093GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
94$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
95$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
96$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
97 $(transform-generated-source)
98LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -070099
Tao Bao4102b282016-11-02 16:17:17 -0700100# A copy of the testdata to be packed into continuous_native_tests.zip.
101testdata_continuous_zip_prefix := \
102 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA
103testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery
104GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files))
105$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
106$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
107$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/%
Tao Baof1338fb2016-10-25 15:05:40 -0700108 $(transform-generated-source)
Tao Bao4102b282016-11-02 16:17:17 -0700109LOCAL_GENERATED_SOURCES += $(GEN)
110LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
Tao Baof1338fb2016-10-25 15:05:40 -0700111
Dan Albert13f21c22014-10-16 17:39:31 -0700112include $(BUILD_NATIVE_TEST)