From 4102b281324eca22cd4ef0922a79949ec6cf846e Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 2 Nov 2016 16:17:17 -0700 Subject: tests: Set up testdata path for continuous native tests. continuous_native_tests expects the testdata under DATA/ in continuous_native_tests.zip. This CL packs a copy of the testdata into continuous_native_tests.zip as DATA/nativetest/recovery/testdata (via LOCAL_PICKUP_FILES). This CL also removes the extra copy for nativetest64. Testdata will always stay at /data/nativetest/recovery/testdata, even for 64-bit version. Otherwise we will unnecessarily get four copies (two for data/ and another two for DATA/). Bug: 32123241 Test: mmma bootable/recovery && adb sync data. On bullhead, /data/nativetest/recovery_component_test/recovery_component_test works; /data/nativetest64/recovery_component_test/recovery_component_test works. Test: m continuous_native_test; DATA/nativetest/recovery/testdata exists. Change-Id: Ifefa0309de7af23c77654e8e450848ca2da218c2 --- tests/Android.mk | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tests/Android.mk') diff --git a/tests/Android.mk b/tests/Android.mk index 461d6ef76..8f19992b6 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -87,7 +87,8 @@ LOCAL_STATIC_LIBRARIES := \ testdata_files := $(call find-subdir-files, testdata/*) -testdata_out_path := $(TARGET_OUT_DATA_NATIVE_TESTS)/recovery +# The testdata files that will go to $OUT/data/nativetest/recovery. +testdata_out_path := $(TARGET_OUT_DATA)/nativetest/recovery GEN := $(addprefix $(testdata_out_path)/, $(testdata_files)) $(GEN): PRIVATE_PATH := $(LOCAL_PATH) $(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ @@ -95,14 +96,16 @@ $(GEN): $(testdata_out_path)/% : $(LOCAL_PATH)/% $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -ifdef TARGET_2ND_ARCH -testdata_out_path_2nd_arch := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/recovery -GEN_2ND_ARCH := $(addprefix $(testdata_out_path_2nd_arch)/, $(testdata_files)) -$(GEN_2ND_ARCH): PRIVATE_PATH := $(LOCAL_PATH) -$(GEN_2ND_ARCH): PRIVATE_CUSTOM_TOOL = cp $< $@ -$(GEN_2ND_ARCH): $(testdata_out_path_2nd_arch)/% : $(LOCAL_PATH)/% +# A copy of the testdata to be packed into continuous_native_tests.zip. +testdata_continuous_zip_prefix := \ + $(call intermediates-dir-for,PACKAGING,recovery_component_test)/DATA +testdata_continuous_zip_path := $(testdata_continuous_zip_prefix)/nativetest/recovery +GEN := $(addprefix $(testdata_continuous_zip_path)/, $(testdata_files)) +$(GEN): PRIVATE_PATH := $(LOCAL_PATH) +$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ +$(GEN): $(testdata_continuous_zip_path)/% : $(LOCAL_PATH)/% $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN_2ND_ARCH) -endif # TARGET_2ND_ARCH +LOCAL_GENERATED_SOURCES += $(GEN) +LOCAL_PICKUP_FILES := $(testdata_continuous_zip_prefix) include $(BUILD_NATIVE_TEST) -- cgit v1.2.3