From 415ee12c762e8ee760495d9c734bb8b654911580 Mon Sep 17 00:00:00 2001 From: Zhenhuang Wang Date: Fri, 5 Aug 2022 20:51:50 +0800 Subject: [PATCH] Export test_options.tags to module-info The test_options.tags attribute modifies execution behavior when running tests in ATest Bazel mode. Exporting the value to module-info enables ATest to add them to the corresponding Bazel target. Bug: 240928948 Test: manually add `test_options.tags` attribute and run: $ refreshmod && \ cat out/target/product/generic/module-info.json |\ grep Change-Id: I1a70d5c66703ed6a5a250459a80e8bca71d659b6 --- core/base_rules.mk | 3 +++ core/clear_vars.mk | 1 + core/tasks/module-info.mk | 1 + 3 files changed, 5 insertions(+) diff --git a/core/base_rules.mk b/core/base_rules.mk index 355a22e945..9bb6c4718a 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -1121,6 +1121,9 @@ endif ifdef LOCAL_IS_UNIT_TEST ALL_MODULES.$(my_register_name).IS_UNIT_TEST := $(LOCAL_IS_UNIT_TEST) endif +ifdef LOCAL_TEST_OPTIONS_TAGS +ALL_MODULES.$(my_register_name).TEST_OPTIONS_TAGS := $(LOCAL_TEST_OPTIONS_TAGS) +endif test_config := INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(my_register_name) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index b5b371c186..8fe5214af7 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -134,6 +134,7 @@ LOCAL_IS_FUZZ_TARGET:= LOCAL_IS_HOST_MODULE:= LOCAL_IS_RUNTIME_RESOURCE_OVERLAY:= LOCAL_IS_UNIT_TEST:= +LOCAL_TEST_OPTIONS_TAGS:= LOCAL_JACK_CLASSPATH:= LOCAL_JACK_COVERAGE_EXCLUDE_FILTER:= LOCAL_JACK_COVERAGE_INCLUDE_FILTER:= diff --git a/core/tasks/module-info.mk b/core/tasks/module-info.mk index 4ef6eb8fcb..0b93a9ec76 100644 --- a/core/tasks/module-info.mk +++ b/core/tasks/module-info.mk @@ -24,6 +24,7 @@ $(MODULE_INFO_JSON): '"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \ '"test_mainline_modules": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_MAINLINE_MODULES)),"$(w)", )], ' \ '"is_unit_test": "$(ALL_MODULES.$(m).IS_UNIT_TEST)", ' \ + '"test_options_tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_OPTIONS_TAGS)),"$(w)", )], ' \ '"data": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA)),"$(w)", )], ' \ '"runtime_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_RUNTIME_LIBRARIES)),"$(w)", )], ' \ '"data_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA_BINS)),"$(w)", )], ' \