From 2035abfb8df290346c17ced0e513cec8dcf15404 Mon Sep 17 00:00:00 2001 From: Dan Shi Date: Mon, 8 Jan 2018 14:16:51 -0800 Subject: [PATCH] Add a flag to disable auto-generating test configs. Bug: 71714007 Test: m -j m -j NotificationStressTests confirm NotificationStressTests.config generated Change-Id: I372a227a07633ab8d335a8435baf5dd6081bb27e --- core/base_rules.mk | 17 +++++++++++++---- core/clear_vars.mk | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index cebf52baf..313c30280 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -541,14 +541,23 @@ ifeq (,$(test_config)) ifeq (true, $(LOCAL_IS_HOST_MODULE)) is_instrumentation_test := false endif + # If LOCAL_MODULE_CLASS is not APPS, it's certainly not an instrumentation + # test. However, some packages for test data also have LOCAL_MODULE_CLASS + # set to APPS. These will require flag LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG + # to disable auto-generating test config file. + ifneq (APPS, $(LOCAL_MODULE_CLASS)) + is_instrumentation_test := false + endif endif # CTS modules can be used for test data, so test config files must be # explicitly created using AndroidTest.xml ifeq (,$(filter cts, $(LOCAL_COMPATIBILITY_SUITE))) - ifeq (true, $(filter true,$(is_native) $(is_instrumentation_test))) - include $(BUILD_SYSTEM)/autogen_test_config.mk - test_config := $(autogen_test_config_file) - autogen_test_config_file := + ifneq (true, $(LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG)) + ifeq (true, $(filter true,$(is_native) $(is_instrumentation_test))) + include $(BUILD_SYSTEM)/autogen_test_config.mk + test_config := $(autogen_test_config_file) + autogen_test_config_file := + endif endif endif endif diff --git a/core/clear_vars.mk b/core/clear_vars.mk index b4a03ea11..b2522eec7 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -55,6 +55,7 @@ LOCAL_DEX_PREOPT_GENERATE_PROFILE:= LOCAL_DEX_PREOPT_IMAGE_LOCATION:= LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING:= LOCAL_DEX_PREOPT:= # '',true,false,nostripping +LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG:= LOCAL_DONT_CHECK_MODULE:= # Don't delete the META_INF dir when merging static Java libraries. LOCAL_DONT_DELETE_JAR_META_INF:=