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_CFLAGS := -Werror 22LOCAL_MODULE := recovery_unit_test 23LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 24LOCAL_STATIC_LIBRARIES := \ 25 libverifier \ 26 libminui \ 27 libotautil \ 28 libziparchive \ 29 libutils \ 30 libz \ 31 libselinux \ 32 libbase 33 34LOCAL_SRC_FILES := \ 35 unit/asn1_decoder_test.cpp \ 36 unit/dirutil_test.cpp \ 37 unit/locale_test.cpp \ 38 unit/sysutil_test.cpp \ 39 unit/zip_test.cpp \ 40 unit/ziputil_test.cpp 41 42LOCAL_C_INCLUDES := bootable/recovery 43LOCAL_SHARED_LIBRARIES := liblog 44include $(BUILD_NATIVE_TEST) 45 46# Manual tests 47include $(CLEAR_VARS) 48LOCAL_CLANG := true 49LOCAL_CFLAGS := -Werror 50LOCAL_MODULE := recovery_manual_test 51LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 52LOCAL_STATIC_LIBRARIES := \ 53 libminui \ 54 libbase 55 56LOCAL_SRC_FILES := manual/recovery_test.cpp 57LOCAL_SHARED_LIBRARIES := \ 58 liblog \ 59 libpng 60 61resource_files := $(call find-files-in-subdirs, bootable/recovery, \ 62 "*_text.png", \ 63 res-mdpi/images \ 64 res-hdpi/images \ 65 res-xhdpi/images \ 66 res-xxhdpi/images \ 67 res-xxxhdpi/images \ 68 ) 69 70# The resource image files that will go to $OUT/data/nativetest/recovery. 71testimage_out_path := $(TARGET_OUT_DATA)/nativetest/recovery 72GEN := $(addprefix $(testimage_out_path)/, $(resource_files)) 73 74$(GEN): PRIVATE_PATH := $(LOCAL_PATH) 75$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ 76$(GEN): $(testimage_out_path)/% : bootable/recovery/% 77 $(transform-generated-source) 78LOCAL_GENERATED_SOURCES += $(GEN) 79 80include $(BUILD_NATIVE_TEST) 81 82# Component tests 83include $(CLEAR_VARS) 84LOCAL_CFLAGS := \ 85 -Werror \ 86 -D_FILE_OFFSET_BITS=64 87 88LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 89 90ifeq ($(AB_OTA_UPDATER),true) 91LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 92endif 93 94LOCAL_MODULE := recovery_component_test 95LOCAL_C_INCLUDES := bootable/recovery 96LOCAL_SRC_FILES := \ 97 component/applypatch_test.cpp \ 98 component/bootloader_message_test.cpp \ 99 component/edify_test.cpp \ 100 component/imgdiff_test.cpp \ 101 component/install_test.cpp \ 102 component/sideload_test.cpp \ 103 component/uncrypt_test.cpp \ 104 component/updater_test.cpp \ 105 component/verifier_test.cpp 106 107LOCAL_FORCE_STATIC_EXECUTABLE := true 108 109tune2fs_static_libraries := \ 110 libext2_com_err \ 111 libext2_blkid \ 112 libext2_quota \ 113 libext2_uuid \ 114 libext2_e2p \ 115 libext2fs 116 117LOCAL_STATIC_LIBRARIES := \ 118 libapplypatch_modes \ 119 libapplypatch \ 120 libedify \ 121 libimgdiff \ 122 libimgpatch \ 123 libbsdiff \ 124 libbspatch \ 125 libotafault \ 126 librecovery \ 127 libupdater \ 128 libbootloader_message \ 129 libverifier \ 130 libotautil \ 131 libmounts \ 132 libdivsufsort \ 133 libdivsufsort64 \ 134 libfs_mgr \ 135 liblog \ 136 libvintf_recovery \ 137 libvintf \ 138 libtinyxml2 \ 139 libselinux \ 140 libext4_utils \ 141 libsparse \ 142 libcrypto_utils \ 143 libcrypto \ 144 libbz \ 145 libziparchive \ 146 libutils \ 147 libz \ 148 libbase \ 149 libtune2fs \ 150 libfec \ 151 libfec_rs \ 152 libsquashfs_utils \ 153 libcutils \ 154 $(tune2fs_static_libraries) 155 156testdata_files := $(call find-subdir-files, testdata/*) 157 158# The testdata files that will go to $OUT/data/nativetest/recovery. 159testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery 160GEN := $(addprefix $(testdata_out_path)/, $(testdata_files)) 161$(GEN): PRIVATE_PATH := $(LOCAL_PATH) 162$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ 163$(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/% 164 $(transform-generated-source) 165LOCAL_GENERATED_SOURCES += $(GEN) 166 167# A copy of the testdata to be packed into continuous_native_tests.zip. 168testdata_continuous_zip_prefix := \ 169 $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA 170testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery 171GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files)) 172$(GEN): PRIVATE_PATH := $(LOCAL_PATH) 173$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ 174$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/% 175 $(transform-generated-source) 176LOCAL_GENERATED_SOURCES += $(GEN) 177LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix) 178 179include $(BUILD_NATIVE_TEST) 180 181# Host tests 182include $(CLEAR_VARS) 183LOCAL_CFLAGS := -Werror 184LOCAL_MODULE := recovery_host_test 185LOCAL_MODULE_HOST_OS := linux 186LOCAL_C_INCLUDES := bootable/recovery 187LOCAL_SRC_FILES := \ 188 component/imgdiff_test.cpp 189LOCAL_STATIC_LIBRARIES := \ 190 libimgdiff \ 191 libimgpatch \ 192 libbsdiff \ 193 libbspatch \ 194 libziparchive \ 195 libutils \ 196 libbase \ 197 libcrypto \ 198 libbz \ 199 libdivsufsort64 \ 200 libdivsufsort \ 201 libz 202LOCAL_SHARED_LIBRARIES := \ 203 liblog 204include $(BUILD_HOST_NATIVE_TEST) 205