rust: Add require_root and vendor install base
Adds the require_root property to rust_test modules so that tests can run as root. Also adds an install base to allow vendor tests to install to a different path, otherwise installs to 'unrestricted' like cc_test. Bug: 200602232 Test: test with require_root: true runs as root Test: test installed to new base directory Change-Id: Ifa716871ff87471f0c0caff7af558d47db85ccd1
This commit is contained in:
@@ -227,17 +227,17 @@ func AutoGenPythonBinaryHostTestConfig(ctx android.ModuleContext, testConfigProp
|
||||
}
|
||||
|
||||
func AutoGenRustTestConfig(ctx android.ModuleContext, testConfigProp *string,
|
||||
testConfigTemplateProp *string, testSuites []string, config []Config, autoGenConfig *bool) android.Path {
|
||||
testConfigTemplateProp *string, testSuites []string, config []Config, autoGenConfig *bool, testInstallBase string) android.Path {
|
||||
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig, testConfigTemplateProp)
|
||||
if autogenPath != nil {
|
||||
templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp)
|
||||
if templatePath.Valid() {
|
||||
autogenTemplate(ctx, autogenPath, templatePath.String(), config, "")
|
||||
autogenTemplate(ctx, autogenPath, templatePath.String(), config, testInstallBase)
|
||||
} else {
|
||||
if ctx.Device() {
|
||||
autogenTemplate(ctx, autogenPath, "${RustDeviceTestConfigTemplate}", config, "")
|
||||
autogenTemplate(ctx, autogenPath, "${RustDeviceTestConfigTemplate}", config, testInstallBase)
|
||||
} else {
|
||||
autogenTemplate(ctx, autogenPath, "${RustHostTestConfigTemplate}", config, "")
|
||||
autogenTemplate(ctx, autogenPath, "${RustHostTestConfigTemplate}", config, testInstallBase)
|
||||
}
|
||||
}
|
||||
return autogenPath
|
||||
|
Reference in New Issue
Block a user