blob: 4fc92fa950d08eeab701340c95430ed2a4f52b63 [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
Michael Bestasc86b6d42017-04-28 22:43:09 +030019ifdef project-path-for
20 RECOVERY_PATH := $(call project-path-for,recovery)
21else
22 RECOVERY_PATH := bootable/recovery
23endif
24
Jed Estep43291862016-02-03 17:02:09 -080025# Unit tests
26include $(CLEAR_VARS)
27LOCAL_CLANG := true
28LOCAL_MODULE := recovery_unit_test
29LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Tianjie Xu2430e292016-04-19 15:02:41 -070030LOCAL_STATIC_LIBRARIES := \
31 libverifier \
32 libminui
33
Jed Estep43291862016-02-03 17:02:09 -080034LOCAL_SRC_FILES := unit/asn1_decoder_test.cpp
Mark Salyzyn13aca592016-03-09 14:58:16 -080035LOCAL_SRC_FILES += unit/recovery_test.cpp
Tianjie Xu2430e292016-04-19 15:02:41 -070036LOCAL_SRC_FILES += unit/locale_test.cpp
Michael Bestasc86b6d42017-04-28 22:43:09 +030037LOCAL_C_INCLUDES := $(RECOVERY_PATH)
Mark Salyzyn13aca592016-03-09 14:58:16 -080038LOCAL_SHARED_LIBRARIES := liblog
Jed Estep43291862016-02-03 17:02:09 -080039include $(BUILD_NATIVE_TEST)
40
41# Component tests
Kenny Root7a4adb52013-10-09 10:14:35 -070042include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -070043LOCAL_CLANG := true
Jed Estepb8a693b2016-03-09 17:51:34 -080044LOCAL_CFLAGS += -Wno-unused-parameter
Dan Albert13f21c22014-10-16 17:39:31 -070045LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jed Estep43291862016-02-03 17:02:09 -080046LOCAL_MODULE := recovery_component_test
Michael Bestasc86b6d42017-04-28 22:43:09 +030047LOCAL_C_INCLUDES := $(RECOVERY_PATH)
Jed Estepb8a693b2016-03-09 17:51:34 -080048LOCAL_SRC_FILES := \
49 component/verifier_test.cpp \
50 component/applypatch_test.cpp
Jed Estep43291862016-02-03 17:02:09 -080051LOCAL_FORCE_STATIC_EXECUTABLE := true
52LOCAL_STATIC_LIBRARIES := \
Jed Estepb8a693b2016-03-09 17:51:34 -080053 libapplypatch \
54 libotafault \
55 libmtdutils \
Jed Estep43291862016-02-03 17:02:09 -080056 libbase \
57 libverifier \
Jed Estepb8a693b2016-03-09 17:51:34 -080058 libcrypto_static \
Jed Estep43291862016-02-03 17:02:09 -080059 libminui \
60 libminzip \
61 libcutils \
Jed Estepb8a693b2016-03-09 17:51:34 -080062 libbz \
63 libz \
Jed Estep43291862016-02-03 17:02:09 -080064 libc
65
Jed Estepb8a693b2016-03-09 17:51:34 -080066testdata_out_path := $(TARGET_OUT_DATA_NATIVE_TESTS)/recovery
Jed Estep43291862016-02-03 17:02:09 -080067testdata_files := $(call find-subdir-files, testdata/*)
68
69GEN := $(addprefix $(testdata_out_path)/, $(testdata_files))
70$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
71$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
72$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/%
73 $(transform-generated-source)
74LOCAL_GENERATED_SOURCES += $(GEN)
Dan Albert13f21c22014-10-16 17:39:31 -070075include $(BUILD_NATIVE_TEST)