Allow Soong to autogenerate test configs
Move the configuration for autogenerating test configs into Soong, and add LOCAL_FULL_TEST_CONFIG so that Soong can specify the full path to a generated test config. Also add a java junit test config template. Bug: 70770641 Test: m checkbuild Test: atest CtsUiRenderingTestCases Test: atest junit-params-test Change-Id: I2e64bc33c949ab7b342be518f94a81a186fe9c07
This commit is contained in:
@@ -583,10 +583,12 @@ else
|
|||||||
$(eval n := $(or $(word 2,$(p)),$(notdir $(word 1, $(p))))) \
|
$(eval n := $(or $(word 2,$(p)),$(notdir $(word 1, $(p))))) \
|
||||||
$(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
$(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
||||||
$(s):$(dir)/$(n)))))
|
$(s):$(dir)/$(n)))))
|
||||||
ifeq (,$(LOCAL_TEST_CONFIG))
|
ifneq (,$(LOCAL_FULL_TEST_CONFIG))
|
||||||
test_config := $(wildcard $(LOCAL_PATH)/AndroidTest.xml)
|
test_config := $(LOCAL_FULL_TEST_CONFIG)
|
||||||
else
|
else ifneq (,$(LOCAL_TEST_CONFIG))
|
||||||
test_config := $(LOCAL_PATH)/$(LOCAL_TEST_CONFIG)
|
test_config := $(LOCAL_PATH)/$(LOCAL_TEST_CONFIG)
|
||||||
|
else
|
||||||
|
test_config := $(wildcard $(LOCAL_PATH)/AndroidTest.xml)
|
||||||
endif
|
endif
|
||||||
ifeq (,$(test_config))
|
ifeq (,$(test_config))
|
||||||
ifneq (true,$(is_native))
|
ifneq (true,$(is_native))
|
||||||
@@ -639,6 +641,19 @@ else
|
|||||||
endif
|
endif
|
||||||
endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
|
endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
|
||||||
|
|
||||||
|
# HACK: pretend a soong LOCAL_FULL_TEST_CONFIG is autogenerated by copying it to
|
||||||
|
# the location autogenerated test configs use and setting the flag in
|
||||||
|
# module-info.json
|
||||||
|
ifdef LOCAL_FULL_TEST_CONFIG
|
||||||
|
ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
||||||
|
my_test_config_file := $(dir $(LOCAL_BUILT_MODULE))$(LOCAL_MODULE).config
|
||||||
|
$(eval $(call copy-one-file,$(LOCAL_FULL_TEST_CONFIG),$(my_test_config_file)))
|
||||||
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_test_config_file))
|
||||||
|
ALL_MODULES.$(my_register_name).auto_test_config := true
|
||||||
|
my_test_config_file :=
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(my_test_data_file_pairs),)
|
ifneq ($(my_test_data_file_pairs),)
|
||||||
$(foreach pair, $(my_test_data_file_pairs), \
|
$(foreach pair, $(my_test_data_file_pairs), \
|
||||||
$(eval parts := $(subst :,$(space),$(pair))) \
|
$(eval parts := $(subst :,$(space),$(pair))) \
|
||||||
|
@@ -94,10 +94,11 @@ LOCAL_EXTRACT_DPI_APK:=
|
|||||||
LOCAL_FDO_SUPPORT:=
|
LOCAL_FDO_SUPPORT:=
|
||||||
LOCAL_FINDBUGS_FLAGS:=
|
LOCAL_FINDBUGS_FLAGS:=
|
||||||
LOCAL_FORCE_STATIC_EXECUTABLE:=
|
LOCAL_FORCE_STATIC_EXECUTABLE:=
|
||||||
LOCAL_FULL_LIBS_MANIFEST_FILES:=
|
|
||||||
LOCAL_FULL_MANIFEST_FILE:=
|
|
||||||
LOCAL_FULL_CLASSES_JACOCO_JAR:=
|
LOCAL_FULL_CLASSES_JACOCO_JAR:=
|
||||||
LOCAL_FULL_CLASSES_PRE_JACOCO_JAR:=
|
LOCAL_FULL_CLASSES_PRE_JACOCO_JAR:=
|
||||||
|
LOCAL_FULL_LIBS_MANIFEST_FILES:=
|
||||||
|
LOCAL_FULL_MANIFEST_FILE:=
|
||||||
|
LOCAL_FULL_TEST_CONFIG:=
|
||||||
LOCAL_FUZZ_ENGINE:=
|
LOCAL_FUZZ_ENGINE:=
|
||||||
LOCAL_GCNO_FILES:=
|
LOCAL_GCNO_FILES:=
|
||||||
LOCAL_GENERATED_SOURCES:=
|
LOCAL_GENERATED_SOURCES:=
|
||||||
|
@@ -167,15 +167,6 @@ BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_static_java
|
|||||||
BUILD_HOST_TEST_CONFIG := $(BUILD_SYSTEM)/host_test_config.mk
|
BUILD_HOST_TEST_CONFIG := $(BUILD_SYSTEM)/host_test_config.mk
|
||||||
BUILD_TARGET_TEST_CONFIG := $(BUILD_SYSTEM)/target_test_config.mk
|
BUILD_TARGET_TEST_CONFIG := $(BUILD_SYSTEM)/target_test_config.mk
|
||||||
|
|
||||||
INSTRUMENTATION_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/instrumentation_test_config_template.xml
|
|
||||||
NATIVE_BENCHMARK_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/native_benchmark_test_config_template.xml
|
|
||||||
NATIVE_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/native_test_config_template.xml
|
|
||||||
EMPTY_TEST_CONFIG := $(BUILD_SYSTEM)/empty_test_config.xml
|
|
||||||
NATIVE_HOST_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/native_host_test_config_template.xml
|
|
||||||
|
|
||||||
# Tool to generate TradeFed test config file automatically.
|
|
||||||
AUTOGEN_TEST_CONFIG_SCRIPT := build/make/tools/auto_gen_test_config.py
|
|
||||||
|
|
||||||
# ###############################################################
|
# ###############################################################
|
||||||
# Parse out any modifier targets.
|
# Parse out any modifier targets.
|
||||||
# ###############################################################
|
# ###############################################################
|
||||||
|
23
core/java_host_test_config_template.xml
Normal file
23
core/java_host_test_config_template.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2018 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.
|
||||||
|
-->
|
||||||
|
<!-- This test config file is auto-generated. -->
|
||||||
|
<configuration description="Runs {MODULE}">
|
||||||
|
<option name="test-suite-tag" value="apct" />
|
||||||
|
<option name="test-suite-tag" value="apct-junit" />
|
||||||
|
<test class="com.android.tradefed.testtype.HostTest" >
|
||||||
|
<option name="jar" value="{MODULE}.jar" />
|
||||||
|
</test>
|
||||||
|
</configuration>
|
30
core/java_test_config_template.xml
Normal file
30
core/java_test_config_template.xml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2018 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.
|
||||||
|
-->
|
||||||
|
<!-- This test config file is auto-generated. -->
|
||||||
|
<configuration description="Runs {MODULE}.">
|
||||||
|
<option name="test-suite-tag" value="apct" />
|
||||||
|
<option name="test-suite-tag" value="apct-junit" />
|
||||||
|
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
|
||||||
|
<option name="cleanup" value="true" />
|
||||||
|
<option name="push" value="cts-dalvik-device-test-runner.jar->/data/local/tmp/{MODULE}/cts-dalvik-device-test-runner.jar" />
|
||||||
|
<option name="push" value="{MODULE}.jar->/data/local/tmp/{MODULE}/{MODULE}.jar" />
|
||||||
|
</target_preparer>
|
||||||
|
<test class="com.android.compatibility.testtype.DalvikTest" >
|
||||||
|
<option name="run-name" value="{MODULE}" />
|
||||||
|
<option name="classpath" value="/data/local/tmp/{MODULE}/{MODULE}.jar" />
|
||||||
|
<option name="classpath" value="/data/local/tmp/{MODULE}/cts-dalvik-device-test-runner.jar" />
|
||||||
|
</test>
|
||||||
|
</configuration>
|
Reference in New Issue
Block a user