Merge "Add build script to generate TF test XML file with filters" am: 0765d53239

am: 515896c436

Change-Id: Id93e51733f0af93aff41e78ce2a1b92e2376befa
This commit is contained in:
Dan Shi 2017-12-07 03:58:20 +00:00 committed by android-build-merger
commit da1ba69776
7 changed files with 113 additions and 1 deletions

View File

@ -244,6 +244,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:=

View File

@ -155,6 +155,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.

View File

@ -3027,7 +3027,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

View File

@ -391,6 +391,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
@ -466,6 +468,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

25
core/host_test_config.mk Normal file
View File

@ -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

View File

@ -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

View File

@ -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 :=