diff options
| author | 2018-09-19 02:21:28 -0700 | |
|---|---|---|
| committer | 2018-09-26 18:02:55 -0700 | |
| commit | 3333889da5b31132fef90848b7630e1b2e793363 (patch) | |
| tree | 3a2e35b06d99246e3f47b8c859f28a8dc0407792 /java/java.go | |
| parent | ce6b038a5504f7ff4c242367d36904400893c7d7 (diff) | |
TradeFed: Add "test_config_template" flag in Android.bp
* Allow module owner to specify a test_config_template in Android.bp
* The rule goes:
1. When "test_config" is set, Soong uses specified test config
2. If 1 is not true, check if "AndroidTest.xml" exist in the
directory, if so, use "AndroidTest.xml
3. If 1 and 2 are not true, check if "test_config_template" is set.
If so, use module specific template to generate test config
4. Otherwise, use Soong default template for test config for autogen
Bug: 113359343
Test: make
Change-Id: I9fb4b2b266be9e0c7cf23da4a51e1c8ae67cd857
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go index 3332482c3..0bd7857a0 100644 --- a/java/java.go +++ b/java/java.go @@ -1446,6 +1446,10 @@ type testProperties struct { // installed with the module. Test_config *string `android:"arch_variant"` + // the name of the test configuration template (for example "AndroidTestTemplate.xml") that + // should be installed with the module. + Test_config_template *string `android:"arch_variant"` + // list of files or filegroup modules that provide data that should be installed alongside // the test Data []string @@ -1461,7 +1465,7 @@ type Test struct { } func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) { - j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config) + j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config, j.testProperties.Test_config_template) j.data = ctx.ExpandSources(j.testProperties.Data, nil) j.Library.GenerateAndroidBuildActions(ctx) @@ -1470,6 +1474,7 @@ func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) { func (j *Test) DepsMutator(ctx android.BottomUpMutatorContext) { j.deps(ctx) android.ExtractSourceDeps(ctx, j.testProperties.Test_config) + android.ExtractSourceDeps(ctx, j.testProperties.Test_config_template) android.ExtractSourcesDeps(ctx, j.testProperties.Data) } |