1# 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 17LOCAL_PATH := $(call my-dir) 18 19# Unit tests 20include $(CLEAR_VARS) 21LOCAL_CLANG := true 22LOCAL_MODULE := recovery_unit_test 23LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 24LOCAL_STATIC_LIBRARIES := \ 25 libverifier \ 26 libminui 27 28LOCAL_SRC_FILES := unit/asn1_decoder_test.cpp 29LOCAL_SRC_FILES += unit/recovery_test.cpp 30LOCAL_SRC_FILES += unit/locale_test.cpp 31LOCAL_C_INCLUDES := bootable/recovery 32LOCAL_SHARED_LIBRARIES := liblog 33include $(BUILD_NATIVE_TEST) 34 35# Component tests 36include $(CLEAR_VARS) 37LOCAL_CLANG := true 38LOCAL_CFLAGS += -Wno-unused-parameter 39LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 40LOCAL_MODULE := recovery_component_test 41LOCAL_C_INCLUDES := bootable/recovery 42LOCAL_SRC_FILES := \ 43 component/verifier_test.cpp \ 44 component/applypatch_test.cpp 45LOCAL_FORCE_STATIC_EXECUTABLE := true 46LOCAL_STATIC_LIBRARIES := \ 47 libapplypatch \ 48 libotafault \ 49 libmtdutils \ 50 libbase \ 51 libverifier \ 52 libcrypto_static \ 53 libminui \ 54 libminzip \ 55 libcutils \ 56 libbz \ 57 libz \ 58 libc 59 60testdata_out_path := $(TARGET_OUT_DATA_NATIVE_TESTS)/recovery 61testdata_files := $(call find-subdir-files, testdata/*) 62 63GEN := $(addprefix $(testdata_out_path)/, $(testdata_files)) 64$(GEN): PRIVATE_PATH := $(LOCAL_PATH) 65$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ 66$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/% 67 $(transform-generated-source) 68LOCAL_GENERATED_SOURCES += $(GEN) 69include $(BUILD_NATIVE_TEST) 70