blob: 461d6ef7678c239edd9fe63f9fbb3a63fcc620bd [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)
21LOCAL_CLANG := true
Tianjie Xu7aa88742016-09-28 11:42:17 -070022LOCAL_CFLAGS := -Werror
Jed Estep43291862016-02-03 17:02:09 -080023LOCAL_MODULE := recovery_unit_test
24LOCAL_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
Jed Estep43291862016-02-03 17:02:09 -080035LOCAL_SRC_FILES := unit/asn1_decoder_test.cpp
Mark Salyzyna4f701a2016-03-09 14:58:16 -080036LOCAL_SRC_FILES += unit/recovery_test.cpp
Tianjie Xu2430e292016-04-19 15:02:41 -070037LOCAL_SRC_FILES += unit/locale_test.cpp
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070038LOCAL_SRC_FILES += unit/zip_test.cpp
Jed Estep43291862016-02-03 17:02:09 -080039LOCAL_C_INCLUDES := bootable/recovery
Mark Salyzyna4f701a2016-03-09 14:58:16 -080040LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080041include $(BUILD_NATIVE_TEST)
42
43# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070044include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -070045LOCAL_CLANG := true
Tao Bao36c35112016-10-25 14:17:26 -070046LOCAL_CFLAGS := -Werror
Dan Albert13f21c22014-10-16 17:39:31 -070047LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jed Estep43291862016-02-03 17:02:09 -080048LOCAL_MODULE := recovery_component_test
49LOCAL_C_INCLUDES := bootable/recovery
Jed Estepb8a693b2016-03-09 17:51:34 -080050LOCAL_SRC_FILES := \
Tao Bao0c7839a2016-10-10 15:48:37 -070051 component/applypatch_test.cpp \
Tao Baod770d2e2016-10-03 15:26:06 -070052 component/edify_test.cpp \
Tao Bao0c7839a2016-10-10 15:48:37 -070053 component/updater_test.cpp \
54 component/verifier_test.cpp
Jed Estep43291862016-02-03 17:02:09 -080055LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Bao0c7839a2016-10-10 15:48:37 -070056
57tune2fs_static_libraries := \
58 libext2_com_err \
59 libext2_blkid \
60 libext2_quota \
61 libext2_uuid_static \
62 libext2_e2p \
63 libext2fs
64
Jed Estep43291862016-02-03 17:02:09 -080065LOCAL_STATIC_LIBRARIES := \
Tao Bao36c35112016-10-25 14:17:26 -070066 libapplypatch_modes \
Jed Estepb8a693b2016-03-09 17:51:34 -080067 libapplypatch \
Tao Baod770d2e2016-10-03 15:26:06 -070068 libedify \
Jed Estepb8a693b2016-03-09 17:51:34 -080069 libotafault \
Tao Bao0c7839a2016-10-10 15:48:37 -070070 libupdater \
Jed Estep43291862016-02-03 17:02:09 -080071 libverifier \
Jed Estep43291862016-02-03 17:02:09 -080072 libminui \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -070073 libotautil \
Tao Bao0c7839a2016-10-10 15:48:37 -070074 libmounts \
75 liblog \
76 libselinux \
77 libext4_utils_static \
78 libsparse_static \
79 libcrypto_utils \
80 libcrypto \
Jed Estep43291862016-02-03 17:02:09 -080081 libcutils \
Jed Estepb8a693b2016-03-09 17:51:34 -080082 libbz \
83 libz \
Tianjie Xu7b0ad9c2016-08-05 18:00:04 -070084 libbase \
Tao Bao0c7839a2016-10-10 15:48:37 -070085 libtune2fs \
86 $(tune2fs_static_libraries)
Jed Estep43291862016-02-03 17:02:09 -080087
Jed Estep43291862016-02-03 17:02:09 -080088testdata_files := $(call find-subdir-files, testdata/*)
89
Tao Baof1338fb2016-10-25 15:05:40 -070090testdata_out_path := $(TARGET_OUT_DATA_NATIVE_TESTS)/recovery
Jed Estep43291862016-02-03 17:02:09 -080091GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
92$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
93$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
94$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
95 $(transform-generated-source)
96LOCAL_GENERATED_SOURCES += $(GEN)
Tao Baof1338fb2016-10-25 15:05:40 -070097
98ifdef TARGET_2ND_ARCH
99testdata_out_path_2nd_arch := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/recovery
100GEN_2ND_ARCH := $(addprefix $(testdata_out_path_2nd_arch)/, $(testdata_files))
101$(GEN_2ND_ARCH): PRIVATE_PATH := $(LOCAL_PATH)
102$(GEN_2ND_ARCH): PRIVATE_CUSTOM_TOOL = cp $< $@
103$(GEN_2ND_ARCH): $(testdata_out_path_2nd_arch)/% : $(LOCAL_PATH)/%
104 $(transform-generated-source)
105LOCAL_GENERATED_SOURCES += $(GEN_2ND_ARCH)
106endif # TARGET_2ND_ARCH
107
Dan Albert13f21c22014-10-16 17:39:31 -0700108include $(BUILD_NATIVE_TEST)