aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangbill <yangbill@google.com>2020-08-13 16:14:30 +0800
committeryangbill <yangbill@google.com>2020-09-01 10:33:47 +0800
commit85146e5e826a1835e79b2f2e0bad9b2aaaf21f88 (patch)
tree23f67d12b812a330fb7bb4dae84eabc15b9f5fd2
parentc73b31bf2a4af537a01d74bf53e65edb4515eab1 (diff)
downloadbuild-85146e5e826a1835e79b2f2e0bad9b2aaaf21f88.tar.gz
AutoGen: Support NativeTest with vendor namespace.
Set the TEST_ROOT to /data/local/tmp/tests/vendor if LOCAL_VENDOR_MODULE or LOCAL_USE_VNDK be set, if not, set to /data/local/tmp. Bug: 138450837 Test: atest binderVendorDoubleLoadTest Change-Id: I66437816227458a4f5672146b0c9e465c843aa50
-rw-r--r--core/autogen_test_config.mk14
-rw-r--r--core/native_test_config_template.xml4
2 files changed, 15 insertions, 3 deletions
diff --git a/core/autogen_test_config.mk b/core/autogen_test_config.mk
index d4ca56f1b8..137b1185ab 100644
--- a/core/autogen_test_config.mk
+++ b/core/autogen_test_config.mk
@@ -22,6 +22,17 @@
# autogen_test_config_file: Path to the test config file generated.
autogen_test_config_file := $(dir $(LOCAL_BUILT_MODULE))$(LOCAL_MODULE).config
+# TODO: (b/167308193) Switch to /data/local/tests/unrestricted as the default install base.
+autogen_test_install_base := /data/local/tmp
+# Automatically setup test root for native test.
+ifeq (true,$(is_native))
+ ifeq (true,$(LOCAL_VENDOR_MODULE))
+ autogen_test_install_base = /data/local/tests/vendor
+ endif
+ ifeq (true,$(LOCAL_USE_VNDK))
+ autogen_test_install_base = /data/local/tests/vendor
+ endif
+endif
ifeq (true,$(is_native))
ifeq ($(LOCAL_NATIVE_BENCHMARK),true)
autogen_test_config_template := $(NATIVE_BENCHMARK_TEST_CONFIG_TEMPLATE)
@@ -33,10 +44,11 @@ else
endif
endif
# Auto generating test config file for native test
+$(autogen_test_config_file): PRIVATE_TEST_INSTALL_BASE := $(autogen_test_install_base)
$(autogen_test_config_file): PRIVATE_MODULE_NAME := $(LOCAL_MODULE)
$(autogen_test_config_file) : $(autogen_test_config_template)
@echo "Auto generating test config $(notdir $@)"
- $(hide) sed 's&{MODULE}&$(PRIVATE_MODULE_NAME)&g;s&{EXTRA_CONFIGS}&&g' $< > $@
+ $(hide) sed 's&{MODULE}&$(PRIVATE_MODULE_NAME)&g;s&{TEST_INSTALL_BASE}&$(PRIVATE_TEST_INSTALL_BASE)&g;s&{EXTRA_CONFIGS}&&g' $< > $@
my_auto_generate_config := true
else
# Auto generating test config file for instrumentation test
diff --git a/core/native_test_config_template.xml b/core/native_test_config_template.xml
index ef1818f776..ea982cf2f9 100644
--- a/core/native_test_config_template.xml
+++ b/core/native_test_config_template.xml
@@ -22,11 +22,11 @@
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
+ <option name="push" value="{MODULE}->{TEST_INSTALL_BASE}/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="native-test-device-path" value="{TEST_INSTALL_BASE}" />
<option name="module-name" value="{MODULE}" />
</test>
</configuration>