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: I04acf12976dd24b9bf880a6775fa4f043a221001
This commit is contained in:
yangbill
2020-08-13 16:16:56 +08:00
parent 588aae727b
commit 5ec4555d22
2 changed files with 38 additions and 30 deletions

View File

@@ -344,6 +344,12 @@ func (test *testBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags {
}
func (test *testBinary) install(ctx ModuleContext, file android.Path) {
// TODO: (b/167308193) Switch to /data/local/tests/unrestricted as the default install base.
testInstallBase := "/data/local/tmp"
if ctx.inVendor() || ctx.useVndk() {
testInstallBase = "/data/local/tests/vendor"
}
dataSrcPaths := android.PathsForModuleSrc(ctx, test.Properties.Data)
for _, dataSrcPath := range dataSrcPaths {
@@ -411,7 +417,7 @@ func (test *testBinary) install(ctx ModuleContext, file android.Path) {
}
test.testConfig = tradefed.AutoGenNativeTestConfig(ctx, test.Properties.Test_config,
test.Properties.Test_config_template, test.Properties.Test_suites, configs, test.Properties.Auto_gen_config)
test.Properties.Test_config_template, test.Properties.Test_suites, configs, test.Properties.Auto_gen_config, testInstallBase)
test.extraTestConfigs = android.PathsForModuleSrc(ctx, test.Properties.Test_options.Extra_test_configs)