Add tests for imgdiff.

Factor out libimgdiff static library for testing purpose.

This CL adds the imgdiff tests on host and on target both (similar to
libimgpatch). In practice, we only need imgdiff binary on host, and
libimgpatch on target. But they should build and pass tests on both
platforms.

Test: recovery_host_test passes; recovery_component_test passes.
Change-Id: I0eafb7faf727cdf70066310e845af6ee245d4f60
This commit is contained in:
Tao Bao
2016-12-15 10:15:06 -08:00
parent e81719dde3
commit 97555da4a6
8 changed files with 813 additions and 267 deletions
+29
View File
@@ -63,6 +63,7 @@ LOCAL_SRC_FILES := \
component/applypatch_test.cpp \
component/bootloader_message_test.cpp \
component/edify_test.cpp \
component/imgdiff_test.cpp \
component/uncrypt_test.cpp \
component/updater_test.cpp \
component/verifier_test.cpp
@@ -81,6 +82,9 @@ LOCAL_STATIC_LIBRARIES := \
libapplypatch_modes \
libapplypatch \
libedify \
libimgdiff \
libimgpatch \
libbsdiff \
libotafault \
libupdater \
libbootloader_message \
@@ -88,6 +92,8 @@ LOCAL_STATIC_LIBRARIES := \
libminui \
libotautil \
libmounts \
libdivsufsort \
libdivsufsort64 \
libfs_mgr \
liblog \
libselinux \
@@ -128,3 +134,26 @@ LOCAL_GENERATED_SOURCES += $(GEN)
LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix)
include $(BUILD_NATIVE_TEST)
# Host tests
include $(CLEAR_VARS)
LOCAL_CFLAGS := -Werror
LOCAL_MODULE := recovery_host_test
LOCAL_MODULE_HOST_OS := linux
LOCAL_C_INCLUDES := bootable/recovery
LOCAL_SRC_FILES := \
component/imgdiff_test.cpp
LOCAL_STATIC_LIBRARIES := \
libimgdiff \
libimgpatch \
libbsdiff \
libziparchive \
libbase \
libcrypto \
libbz \
libdivsufsort64 \
libdivsufsort \
libz
LOCAL_SHARED_LIBRARIES := \
liblog
include $(BUILD_HOST_NATIVE_TEST)