Merge "Add extra_test_configs option" am: ec7a91f9fa
am: 82448f2d2d
am: 180a485b50
am: 437bb3b11d
am: 57fa8ee91c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402168 Change-Id: Ib63b87c02158c5454806a3f14c1aaf9ae890e387
This commit is contained in:
@@ -161,6 +161,7 @@ func (j *Test) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
if j.testConfig != nil {
|
||||
entries.SetPath("LOCAL_FULL_TEST_CONFIG", j.testConfig)
|
||||
}
|
||||
androidMkWriteExtraTestConfigs(j.extraTestConfigs, entries)
|
||||
androidMkWriteTestData(j.data, entries)
|
||||
if !BoolDefault(j.testProperties.Auto_gen_config, true) {
|
||||
entries.SetString("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", "true")
|
||||
@@ -170,6 +171,12 @@ func (j *Test) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
return entriesList
|
||||
}
|
||||
|
||||
func androidMkWriteExtraTestConfigs(extraTestConfigs android.Paths, entries *android.AndroidMkEntries) {
|
||||
if len(extraTestConfigs) > 0 {
|
||||
entries.AddStrings("LOCAL_EXTRA_FULL_TEST_CONFIGS", extraTestConfigs.Strings()...)
|
||||
}
|
||||
}
|
||||
|
||||
func (j *TestHelperLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
entriesList := j.Library.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
@@ -431,6 +438,7 @@ func (a *AndroidTest) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
if a.testConfig != nil {
|
||||
entries.SetPath("LOCAL_FULL_TEST_CONFIG", a.testConfig)
|
||||
}
|
||||
androidMkWriteExtraTestConfigs(a.extraTestConfigs, entries)
|
||||
androidMkWriteTestData(a.data, entries)
|
||||
})
|
||||
|
||||
|
@@ -1064,8 +1064,9 @@ type AndroidTest struct {
|
||||
|
||||
testProperties testProperties
|
||||
|
||||
testConfig android.Path
|
||||
data android.Paths
|
||||
testConfig android.Path
|
||||
extraTestConfigs android.Paths
|
||||
data android.Paths
|
||||
}
|
||||
|
||||
func (a *AndroidTest) InstallInTestcases() bool {
|
||||
@@ -1093,6 +1094,7 @@ func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
testConfig := tradefed.AutoGenInstrumentationTestConfig(ctx, a.testProperties.Test_config,
|
||||
a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites, a.testProperties.Auto_gen_config, configs)
|
||||
a.testConfig = a.FixTestConfig(ctx, testConfig)
|
||||
a.extraTestConfigs = android.PathsForModuleSrc(ctx, a.testProperties.Test_options.Extra_test_configs)
|
||||
a.data = android.PathsForModuleSrc(ctx, a.testProperties.Data)
|
||||
}
|
||||
|
||||
|
16
java/java.go
16
java/java.go
@@ -2128,6 +2128,12 @@ func LibraryHostFactory() android.Module {
|
||||
// Java Tests
|
||||
//
|
||||
|
||||
// Test option struct.
|
||||
type TestOptions struct {
|
||||
// a list of extra test configuration files that should be installed with the module.
|
||||
Extra_test_configs []string `android:"path,arch_variant"`
|
||||
}
|
||||
|
||||
type testProperties struct {
|
||||
// list of compatibility suites (for example "cts", "vts") that the module should be
|
||||
// installed into.
|
||||
@@ -2153,6 +2159,9 @@ type testProperties struct {
|
||||
// Add parameterized mainline modules to auto generated test config. The options will be
|
||||
// handled by TradeFed to do downloading and installing the specified modules on the device.
|
||||
Test_mainline_modules []string
|
||||
|
||||
// Test options.
|
||||
Test_options TestOptions
|
||||
}
|
||||
|
||||
type hostTestProperties struct {
|
||||
@@ -2181,8 +2190,9 @@ type Test struct {
|
||||
|
||||
testProperties testProperties
|
||||
|
||||
testConfig android.Path
|
||||
data android.Paths
|
||||
testConfig android.Path
|
||||
extraTestConfigs android.Paths
|
||||
data android.Paths
|
||||
}
|
||||
|
||||
type TestHost struct {
|
||||
@@ -2221,6 +2231,8 @@ func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
||||
j.data = android.PathsForModuleSrc(ctx, j.testProperties.Data)
|
||||
|
||||
j.extraTestConfigs = android.PathsForModuleSrc(ctx, j.testProperties.Test_options.Extra_test_configs)
|
||||
|
||||
ctx.VisitDirectDepsWithTag(dataNativeBinsTag, func(dep android.Module) {
|
||||
j.data = append(j.data, android.OutputFileForModule(ctx, dep, ""))
|
||||
})
|
||||
|
Reference in New Issue
Block a user