diff options
| author | yelinhsieh <yelinhsieh@google.com> | 2018-11-06 11:49:55 +0800 |
|---|---|---|
| committer | Yelin Hsieh <yelinhsieh@google.com> | 2019-01-14 03:30:06 +0000 |
| commit | 80880a3460a96bd48dce17e3bfa5aec69faf732d (patch) | |
| tree | 64ea06054bf082f478c0961fd8a15ec9ecdaf58b /tradefed | |
| parent | 98975c301e6be189e505c4c16b0fbde94f577f76 (diff) | |
| download | build_soong-80880a3460a96bd48dce17e3bfa5aec69faf732d.tar.gz build_soong-80880a3460a96bd48dce17e3bfa5aec69faf732d.tar.bz2 build_soong-80880a3460a96bd48dce17e3bfa5aec69faf732d.zip | |
Autogen python test config.
Feature request from developer, autogen python test config.
Bug:118442443
Test: $source build/envsetup.sh ; lunch
$sed -i '/test_config/d' tools/acloud/Android.bp
$make acloud_test
$[ -f $ANDROID_HOST_OUT_TESTCASES/acloud_test/acloud_test.config ] && echo "Found" || echo "Not found"
Change-Id: I196230581b456afe03e67f9cd84c028d18ba08d9
Diffstat (limited to 'tradefed')
| -rw-r--r-- | tradefed/autogen.go | 16 | ||||
| -rw-r--r-- | tradefed/config.go | 1 | ||||
| -rw-r--r-- | tradefed/makevars.go | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tradefed/autogen.go b/tradefed/autogen.go index 131fdc44..e6a1b48c 100644 --- a/tradefed/autogen.go +++ b/tradefed/autogen.go @@ -118,6 +118,22 @@ func AutoGenJavaTestConfig(ctx android.ModuleContext, testConfigProp *string, te return path } +func AutoGenPythonBinaryHostTestConfig(ctx android.ModuleContext, testConfigProp *string, + testConfigTemplateProp *string) android.Path { + + path, autogenPath := testConfigPath(ctx, testConfigProp) + if autogenPath != nil { + templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp) + if templatePath.Valid() { + autogenTemplate(ctx, autogenPath, templatePath.String()) + } else { + autogenTemplate(ctx, autogenPath, "${PythonBinaryHostTestConfigTemplate}") + } + return autogenPath + } + return path +} + var autogenInstrumentationTest = pctx.StaticRule("autogenInstrumentationTest", blueprint.RuleParams{ Command: "${AutoGenTestConfigScript} $out $in ${EmptyTestConfig} $template", CommandDeps: []string{ diff --git a/tradefed/config.go b/tradefed/config.go index 2c432d09..141e0c57 100644 --- a/tradefed/config.go +++ b/tradefed/config.go @@ -30,6 +30,7 @@ func init() { pctx.SourcePathVariable("NativeBenchmarkTestConfigTemplate", "build/make/core/native_benchmark_test_config_template.xml") pctx.SourcePathVariable("NativeHostTestConfigTemplate", "build/make/core/native_host_test_config_template.xml") pctx.SourcePathVariable("NativeTestConfigTemplate", "build/make/core/native_test_config_template.xml") + pctx.SourcePathVariable("PythonBinaryHostTestConfigTemplate", "build/make/core/python_binary_host_test_config_template.xml") pctx.SourcePathVariable("EmptyTestConfig", "build/make/core/empty_test_config.xml") } diff --git a/tradefed/makevars.go b/tradefed/makevars.go index 3ec79979..aad7273e 100644 --- a/tradefed/makevars.go +++ b/tradefed/makevars.go @@ -30,6 +30,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("NATIVE_BENCHMARK_TEST_CONFIG_TEMPLATE", "${NativeBenchmarkTestConfigTemplate}") ctx.Strict("NATIVE_HOST_TEST_CONFIG_TEMPLATE", "${NativeHostTestConfigTemplate}") ctx.Strict("NATIVE_TEST_CONFIG_TEMPLATE", "${NativeTestConfigTemplate}") + ctx.Strict("PYTHON_BINARY_HOST_TEST_CONFIG_TEMPLATE", "${PythonBinaryHostTestConfigTemplate}") ctx.Strict("EMPTY_TEST_CONFIG", "${EmptyTestConfig}") } |
