From 3fb354cca08ec30cb6aade8da3f4b5ddd119b227 Mon Sep 17 00:00:00 2001 From: Simran Basi Date: Wed, 8 Feb 2017 15:53:32 -0800 Subject: [PATCH] Output *TS testcases to their own subdir in the common testcase folders. Instead of dumping all *TS testcases into the common testcase directory directly, place them all in their own subdirectory. Bug: 35153177 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: I22a768dba58d40be1e61885534fb813e7ff08c99 --- core/base_rules.mk | 11 +++++++---- core/package_internal.mk | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index a7c9ad2fb..1da65548b 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -424,10 +424,13 @@ ifneq ($(words $(LOCAL_COMPATIBILITY_SUITE)),1) $(error $(LOCAL_PATH):$(LOCAL_MODULE) LOCAL_COMPATIBILITY_SUITE can be only one name) endif +# Copy this module into its own subdirectory in the common testcases output directory. +my_testcases_subdir := $($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE) + # The module itself. my_compat_dist := \ $(LOCAL_BUILT_MODULE):$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem) \ - $(LOCAL_BUILT_MODULE):$($(my_prefix)OUT_TESTCASES)/$(my_installed_module_stem) + $(LOCAL_BUILT_MODULE):$(my_testcases_subdir)/$(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 @@ -439,20 +442,20 @@ my_compat_dist += $(foreach f, $(LOCAL_COMPATIBILITY_SUPPORT_FILES),\ $(eval s := $(word 1,$(p)))\ $(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)) + $(s):$(d) $(s):$(my_testcases_subdir)/$(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 + $(LOCAL_PATH)/AndroidTest.xml:$(my_testcases_subdir)/$(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 + $(LOCAL_PATH)/DynamicConfig.xml:$(my_testcases_subdir)/$(LOCAL_MODULE).dynamic endif endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files diff --git a/core/package_internal.mk b/core/package_internal.mk index f5f58618d..694716a96 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -585,8 +585,8 @@ 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 +common_testcase_file := $(foreach s,$(my_split_suffixes),$($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE)/$(LOCAL_MODULE)_$(s).apk) +$(common_testcase_file) : $($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE)/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk $(copy-file-to-new-target) COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \