diff options
author | 2020-01-29 20:07:03 -0800 | |
---|---|---|
committer | 2020-07-19 19:33:40 -0700 | |
commit | 8eebb135b38009800b3e536d73bed9280e8b6fd9 (patch) | |
tree | 4630b222d640b30723e6960a66f234b27e192aa0 /tradefed | |
parent | 0ae555df1a5b0fc86a6fa83c1de42026ef184cd2 (diff) |
Package robolectric tests for tradefed
Package a slightly modified copy of the robolectric tests with
the dependencies statically included into the testcases directory
and into a robolectric-tests.zip.
Test: m robolectric-tests
Change-Id: I73f51727695136d2a849d36af1683e93f7e156a3
Diffstat (limited to 'tradefed')
-rw-r--r-- | tradefed/autogen.go | 15 | ||||
-rw-r--r-- | tradefed/config.go | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tradefed/autogen.go b/tradefed/autogen.go index 1cb874d7f..798fc40fc 100644 --- a/tradefed/autogen.go +++ b/tradefed/autogen.go @@ -239,6 +239,21 @@ func AutoGenRustTestConfig(ctx android.ModuleContext, testConfigProp *string, return path } +func AutoGenRobolectricTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string, + testSuites []string, autoGenConfig *bool) 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(), nil) + } else { + autogenTemplate(ctx, autogenPath, "${RobolectricTestConfigTemplate}", nil) + } + return autogenPath + } + return path +} + var autogenInstrumentationTest = pctx.StaticRule("autogenInstrumentationTest", blueprint.RuleParams{ Command: "${AutoGenTestConfigScript} $out $in ${EmptyTestConfig} $template ${extraConfigs}", CommandDeps: []string{ diff --git a/tradefed/config.go b/tradefed/config.go index 34195c364..f7e834988 100644 --- a/tradefed/config.go +++ b/tradefed/config.go @@ -33,6 +33,7 @@ func init() { pctx.SourcePathVariable("PythonBinaryHostTestConfigTemplate", "build/make/core/python_binary_host_test_config_template.xml") pctx.SourcePathVariable("RustDeviceTestConfigTemplate", "build/make/core/rust_device_test_config_template.xml") pctx.SourcePathVariable("RustHostTestConfigTemplate", "build/make/core/rust_host_test_config_template.xml") + pctx.SourcePathVariable("RobolectricTestConfigTemplate", "build/make/core/robolectric_test_config_template.xml") pctx.SourcePathVariable("ShellTestConfigTemplate", "build/make/core/shell_test_config_template.xml") pctx.SourcePathVariable("EmptyTestConfig", "build/make/core/empty_test_config.xml") |