Add a flag to disable auto-generating test configs.
Bug: 71714007
Test: m -j <module for *ts suite>
m -j NotificationStressTests
confirm NotificationStressTests.config generated
Change-Id: I372a227a07633ab8d335a8435baf5dd6081bb27e
diff --git a/core/base_rules.mk b/core/base_rules.mk
index cebf52b..313c302 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -541,14 +541,23 @@
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