From 7166d1f43a1e8e58748a0f6e10f68402f5086fea Mon Sep 17 00:00:00 2001 From: Simran Basi Date: Wed, 25 Jan 2017 15:11:55 -0800 Subject: [PATCH] Output *TS testcases to common testcase folders. Aggregates the different *TS testcases into two common folders, one under each the host and product hierarchies. Bug: 34715822 Test: `make cts -j` and checked the contents of both: out/host/linux-x86/testcases/ & out/host/linux-x86/cts/android-cts/testcases/ Change-Id: I7d5201998ddcb011ecc687c272a0d0a36da248b7 --- core/base_rules.mk | 12 +++++++++--- core/envsetup.mk | 4 ++++ core/package_internal.mk | 7 +++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index 68ac08be4..a7c9ad2fb 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -426,7 +426,8 @@ endif # The module itself. my_compat_dist := \ - $(LOCAL_BUILT_MODULE):$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem) + $(LOCAL_BUILT_MODULE):$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem) \ + $(LOCAL_BUILT_MODULE):$($(my_prefix)OUT_TESTCASES)/$(my_installed_module_stem) # Make sure we only add the files once for multilib modules. ifndef $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files @@ -436,17 +437,22 @@ $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files := true my_compat_dist += $(foreach f, $(LOCAL_COMPATIBILITY_SUPPORT_FILES),\ $(eval p := $(subst :,$(space),$(f)))\ $(eval s := $(word 1,$(p)))\ - $(eval d := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(or $(word 2,$(p)),$(notdir $(word 1,$(p)))))\ - $(s):$(d)) + $(eval n := $(or $(word 2,$(p)),$(notdir $(word 1, $(p))))) \ + $(eval d := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(n)) \ + $(s):$(d) $(s):$($(my_prefix)OUT_TESTCASES)/$(n)) ifneq (,$(wildcard $(LOCAL_PATH)/AndroidTest.xml)) my_compat_dist += \ $(LOCAL_PATH)/AndroidTest.xml:$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).config +my_compat_dist += \ + $(LOCAL_PATH)/AndroidTest.xml:$($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE).config endif ifneq (,$(wildcard $(LOCAL_PATH)/DynamicConfig.xml)) my_compat_dist += \ $(LOCAL_PATH)/DynamicConfig.xml:$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).dynamic +my_compat_dist += \ + $(LOCAL_PATH)/DynamicConfig.xml:$($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE).dynamic endif endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files diff --git a/core/envsetup.mk b/core/envsetup.mk index fedd3f3fd..b0f35b15a 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -276,6 +276,7 @@ HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT)/bin HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest HOST_CROSS_OUT_COVERAGE := $(HOST_CROSS_OUT)/coverage +HOST_OUT_TESTCASES := $(HOST_OUT)/testcases HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj HOST_OUT_INTERMEDIATE_LIBRARIES := $(HOST_OUT_INTERMEDIATES)/lib @@ -304,6 +305,7 @@ $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES) $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT_JAVA_LIBRARIES) $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest +$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_TESTCASES := $(HOST_OUT_TESTCASES) # The default host library path. # It always points to the path where we build libraries in the default bitness. @@ -351,6 +353,7 @@ TARGET_OUT_KEYCHARS := $(TARGET_OUT)/usr/keychars TARGET_OUT_ETC := $(TARGET_OUT)/etc TARGET_OUT_NOTICE_FILES := $(TARGET_OUT_INTERMEDIATES)/NOTICE_FILES TARGET_OUT_FAKE := $(PRODUCT_OUT)/fake_packages +TARGET_OUT_TESTCASES := $(PRODUCT_OUT)/testcases TARGET_OUT_SYSTEM_OTHER := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM_OTHER) @@ -373,6 +376,7 @@ $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_RENDERSCRIPT_BITCODE := $($(TARGET_2ND_A $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_EXECUTABLES := $(TARGET_OUT_EXECUTABLES) $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS := $(TARGET_OUT_APPS) $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT_APPS_PRIVILEGED) +$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_TESTCASES := $(TARGET_OUT_TESTCASES) TARGET_OUT_DATA := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA) TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_EXECUTABLES) diff --git a/core/package_internal.mk b/core/package_internal.mk index 5dd021ccd..f5f58618d 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -585,12 +585,15 @@ ifdef LOCAL_COMPATIBILITY_SUITE cts_testcase_file := $(foreach s,$(my_split_suffixes),$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE)_$(s).apk) $(cts_testcase_file) : $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk | $(ACP) $(copy-file-to-new-target) +common_testcase_file := $(foreach s,$(my_split_suffixes),$($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE)_$(s).apk) +$(common_testcase_file) : $($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk + $(copy-file-to-new-target) COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \ $(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \ - $(cts_testcase_file) + $(cts_testcase_file) $(common_testcase_file) -$(my_all_targets) : $(cts_testcase_file) +$(my_all_targets) : $(cts_testcase_file) $(common_testcase_file) endif # LOCAL_COMPATIBILITY_SUITE endif # LOCAL_PACKAGE_SPLITS