Add build script to generate TF test XML file with filters

Bug: 68270274
Test: run 'atest' in frameworks/base
Change-Id: I99b741fae18997caa6aefbd3ab804e5d30e7ae36
gugelfrei-debug
Dan Shi 7 years ago
parent cbb4ec6cf0
commit 26efd3a8d1

@ -236,6 +236,7 @@ LOCAL_STATIC_LIBRARIES:=
LOCAL_STRIP_MODULE:=
LOCAL_SYSTEM_SHARED_LIBRARIES:=none
LOCAL_TARGET_REQUIRED_MODULES:=
LOCAL_TEST_CONFIG_OPTIONS:=
LOCAL_TEST_DATA:=
LOCAL_TEST_MODULE_TO_PROGUARD_WITH:=
LOCAL_TIDY:=

@ -135,6 +135,8 @@ BUILD_NOTICE_FILE := $(BUILD_SYSTEM)/notice_files.mk
BUILD_HOST_DALVIK_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_java_library.mk
BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_static_java_library.mk
BUILD_HOST_TEST_CONFIG:= $(BUILD_SYSTEM)/host_test_config.mk
BUILD_TARGET_TEST_CONFIG:= $(BUILD_SYSTEM)/target_test_config.mk
# ###############################################################
# Parse out any modifier targets.

@ -3018,7 +3018,9 @@ STATS.MODULE_TYPE := \
HOST_DALVIK_JAVA_LIBRARY \
HOST_DALVIK_STATIC_JAVA_LIBRARY \
base_rules \
HEADER_LIBRARY
HEADER_LIBRARY \
HOST_TEST_CONFIG \
TARGET_TEST_CONFIG
$(foreach s,$(STATS.MODULE_TYPE),$(eval STATS.MODULE_TYPE.$(s) :=))
define record-module-type

@ -382,6 +382,8 @@ HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
HOST_CROSS_OUT_GEN := $(HOST_CROSS_OUT)/gen
HOST_OUT_TEST_CONFIG := $(HOST_OUT)/test_config
# Out for HOST_2ND_ARCH
HOST_2ND_ARCH_VAR_PREFIX := 2ND_
HOST_2ND_ARCH_MODULE_SUFFIX := _32
@ -457,6 +459,7 @@ 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_TEST_CONFIG := $(PRODUCT_OUT)/test_config
ifeq ($(SANITIZE_LITE),true)
# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not

@ -0,0 +1,25 @@
#
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Common rules for building a TradeFed test XML file for host side tests.
#
$(call record-module-type,HOST_TEST_CONFIG)
LOCAL_IS_HOST_MODULE := true
include $(BUILD_SYSTEM)/test_config_common.mk

@ -0,0 +1,23 @@
#
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Common rules for building a TradeFed test XML file for target side tests.
#
$(call record-module-type,TARGET_TEST_CONFIG)
include $(BUILD_SYSTEM)/test_config_common.mk

@ -0,0 +1,56 @@
#
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_MODULE_CLASS := TEST_CONFIG
# Output test config files to testcases directory.
ifeq (,$(filter general-tests, $(LOCAL_COMPATIBILITY_SUITE)))
LOCAL_COMPATIBILITY_SUITE += general-tests
endif
LOCAL_MODULE_SUFFIX := .config
my_test_config_file := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE).xml)
LOCAL_SRC_FILES :=
include $(BUILD_SYSTEM)/base_rules.mk
# The test config is not in a standalone XML file.
ifndef my_test_config_file
ifndef LOCAL_TEST_CONFIG_OPTIONS
$(call pretty-error,LOCAL_TEST_CONFIG_OPTIONS must be set if the test XML file is not provided.)
endif
my_base_test_config_file := $(LOCAL_PATH)/AndroidTest.xml
my_test_config_file := $(dir $(LOCAL_BUILT_MODULE))AndroidTest.xml
$(my_test_config_file) : PRIVATE_test_config_options := $(LOCAL_TEST_CONFIG_OPTIONS)
$(my_test_config_file) : $(my_base_test_config_file)
@echo "Create $(notdir $@) with options: $(PRIVATE_test_config_options)."
$(eval _option_xml := \
$(foreach option,$(PRIVATE_test_config_options), \
$(eval p := $(subst :,$(space),$(option))) \
<option name="$(word 1,$(p))" value="$(word 2,$(p))" \/>\n))
$(hide) sed 's&</configuration>&$(_option_xml)</configuration>&' $< > $@
endif # my_test_config_file
$(LOCAL_BUILT_MODULE) : $(my_test_config_file)
$(copy-file-to-target)
my_base_test_config_file :=
my_test_config_file :=
Loading…
Cancel
Save