Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375 Change-Id: I9fd93be8154f2f1372ccde1eb9a37690738692b7
This commit is contained in:
@@ -147,20 +147,21 @@ func (library *Library) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
}
|
||||
|
||||
// Called for modules that are a component of a test suite.
|
||||
func testSuiteComponent(entries *android.AndroidMkEntries, test_suites []string) {
|
||||
func testSuiteComponent(entries *android.AndroidMkEntries, test_suites []string, perTestcaseDirectory bool) {
|
||||
entries.SetString("LOCAL_MODULE_TAGS", "tests")
|
||||
if len(test_suites) > 0 {
|
||||
entries.AddCompatibilityTestSuites(test_suites...)
|
||||
} else {
|
||||
entries.AddCompatibilityTestSuites("null-suite")
|
||||
}
|
||||
entries.SetBoolIfTrue("LOCAL_COMPATIBILITY_PER_TESTCASE_DIRECTORY", perTestcaseDirectory)
|
||||
}
|
||||
|
||||
func (j *Test) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
entriesList := j.Library.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
||||
testSuiteComponent(entries, j.testProperties.Test_suites)
|
||||
testSuiteComponent(entries, j.testProperties.Test_suites, Bool(j.testProperties.Per_testcase_directory))
|
||||
if j.testConfig != nil {
|
||||
entries.SetPath("LOCAL_FULL_TEST_CONFIG", j.testConfig)
|
||||
}
|
||||
@@ -188,7 +189,7 @@ func (j *TestHelperLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
entriesList := j.Library.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
||||
testSuiteComponent(entries, j.testHelperLibraryProperties.Test_suites)
|
||||
testSuiteComponent(entries, j.testHelperLibraryProperties.Test_suites, Bool(j.testHelperLibraryProperties.Per_testcase_directory))
|
||||
})
|
||||
|
||||
return entriesList
|
||||
@@ -450,7 +451,7 @@ func (a *AndroidTest) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
entriesList := a.AndroidApp.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
||||
testSuiteComponent(entries, a.testProperties.Test_suites)
|
||||
testSuiteComponent(entries, a.testProperties.Test_suites, Bool(a.testProperties.Per_testcase_directory))
|
||||
if a.testConfig != nil {
|
||||
entries.SetPath("LOCAL_FULL_TEST_CONFIG", a.testConfig)
|
||||
}
|
||||
@@ -466,7 +467,7 @@ func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
entriesList := a.AndroidApp.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
||||
testSuiteComponent(entries, a.appTestHelperAppProperties.Test_suites)
|
||||
testSuiteComponent(entries, a.appTestHelperAppProperties.Test_suites, Bool(a.appTestHelperAppProperties.Per_testcase_directory))
|
||||
// introduce a flag variable to control the generation of the .config file
|
||||
entries.SetString("LOCAL_DISABLE_TEST_CONFIG", "true")
|
||||
})
|
||||
@@ -677,7 +678,7 @@ func (a *AndroidTestImport) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
entriesList := a.AndroidAppImport.AndroidMkEntries()
|
||||
entries := &entriesList[0]
|
||||
entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
||||
testSuiteComponent(entries, a.testProperties.Test_suites)
|
||||
testSuiteComponent(entries, a.testProperties.Test_suites, Bool(a.testProperties.Per_testcase_directory))
|
||||
androidMkWriteTestData(a.data, entries)
|
||||
})
|
||||
return entriesList
|
||||
|
@@ -1070,6 +1070,9 @@ type appTestHelperAppProperties struct {
|
||||
// doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
|
||||
// explicitly.
|
||||
Auto_gen_config *bool
|
||||
|
||||
// Install the test into a folder named for the module in all test suites.
|
||||
Per_testcase_directory *bool
|
||||
}
|
||||
|
||||
type AndroidTestHelperApp struct {
|
||||
|
@@ -781,6 +781,9 @@ type testProperties struct {
|
||||
|
||||
// Names of modules containing JNI libraries that should be installed alongside the test.
|
||||
Jni_libs []string
|
||||
|
||||
// Install the test into a folder named for the module in all test suites.
|
||||
Per_testcase_directory *bool
|
||||
}
|
||||
|
||||
type hostTestProperties struct {
|
||||
@@ -792,6 +795,9 @@ type testHelperLibraryProperties struct {
|
||||
// list of compatibility suites (for example "cts", "vts") that the module should be
|
||||
// installed into.
|
||||
Test_suites []string `android:"arch_variant"`
|
||||
|
||||
// Install the test into a folder named for the module in all test suites.
|
||||
Per_testcase_directory *bool
|
||||
}
|
||||
|
||||
type prebuiltTestProperties struct {
|
||||
|
Reference in New Issue
Block a user