diff options
author | 2025-03-11 15:55:59 -0700 | |
---|---|---|
committer | 2025-03-11 15:55:59 -0700 | |
commit | 5e1454aef7f1e97890b11db5c85b7655ce8f7380 (patch) | |
tree | 9feac0470368a38e98ebec8ec9a7475594353c0c /cc | |
parent | 7ed094ef25e59df953b422f011eaac8bb1c1eba1 (diff) |
Expand TestSuiteInfoProvider to all test modules
Test suites have been historically only defined in the AndroidMk
functions. But in soong-only builds, we don't run AndroidMk. It appears
Colin already started making a TestSuiteInfo provider, but hadn't
set it on all test modules yet. Expand it to all the test modules,
and add export it to make so that make can check that it matches
LOCAL_COMPATIBILITY_SUITES.
Bug: 388850000
Test: m nothing
Change-Id: Iee8959742117604fd560c95be60f3cb7cf3d9ae4
Diffstat (limited to 'cc')
-rw-r--r-- | cc/binary.go | 4 | ||||
-rw-r--r-- | cc/cc.go | 4 | ||||
-rw-r--r-- | cc/library.go | 4 | ||||
-rw-r--r-- | cc/object.go | 4 | ||||
-rw-r--r-- | cc/test.go | 20 |
5 files changed, 36 insertions, 0 deletions
diff --git a/cc/binary.go b/cc/binary.go index 627d5e560..608251afc 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -551,6 +551,10 @@ func (binary *binaryDecorator) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON binary.baseLinker.moduleInfoJSON(ctx, moduleInfoJSON) } +func (binary *binaryDecorator) testSuiteInfo(ctx ModuleContext) { + // not a test +} + var _ overridable = (*binaryDecorator)(nil) func init() { @@ -797,6 +797,8 @@ type linker interface { defaultDistFiles() []android.Path moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfoJSON) + + testSuiteInfo(ctx ModuleContext) } // specifiedDeps is a tuple struct representing dependencies of a linked binary owned by the linker. @@ -2408,6 +2410,8 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { name := v.ImplementationModuleName(ctx.OtherModuleName(c)) ccInfo.LinkerInfo.ImplementationModuleName = &name } + + c.linker.testSuiteInfo(ctx) } if c.library != nil { ccInfo.LibraryInfo = &LibraryInfo{ diff --git a/cc/library.go b/cc/library.go index b248224bd..5299771ca 100644 --- a/cc/library.go +++ b/cc/library.go @@ -1078,6 +1078,10 @@ func (library *libraryDecorator) moduleInfoJSON(ctx ModuleContext, moduleInfoJSO library.baseLinker.moduleInfoJSON(ctx, moduleInfoJSON) } +func (library *libraryDecorator) testSuiteInfo(ctx ModuleContext) { + // not a test +} + func (library *libraryDecorator) linkStatic(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path { diff --git a/cc/object.go b/cc/object.go index 95a8beb52..ea3ed6151 100644 --- a/cc/object.go +++ b/cc/object.go @@ -250,3 +250,7 @@ func (object *objectLinker) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *an object.baseLinker.moduleInfoJSON(ctx, moduleInfoJSON) moduleInfoJSON.Class = []string{"STATIC_LIBRARIES"} } + +func (object *objectLinker) testSuiteInfo(ctx ModuleContext) { + // not a test +} diff --git a/cc/test.go b/cc/test.go index 8b68c5563..9c276b81a 100644 --- a/cc/test.go +++ b/cc/test.go @@ -274,6 +274,12 @@ func (test *testDecorator) moduleInfoJSON(ctx android.ModuleContext, moduleInfoJ } } +func (test *testDecorator) testSuiteInfo(ctx ModuleContext) { + android.SetProvider(ctx, android.TestSuiteInfoProvider, android.TestSuiteInfo{ + TestSuites: test.InstallerProperties.Test_suites, + }) +} + func NewTestInstaller() *baseInstaller { return NewBaseInstaller("nativetest", "nativetest64", InstallInData) } @@ -342,6 +348,10 @@ func (test *testBinary) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *androi } +func (test *testBinary) testSuiteInfo(ctx ModuleContext) { + test.testDecorator.testSuiteInfo(ctx) +} + func (test *testBinary) installerProps() []interface{} { return append(test.baseInstaller.installerProps(), test.testDecorator.installerProps()...) } @@ -578,6 +588,10 @@ func (test *testLibrary) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *andro test.testDecorator.moduleInfoJSON(ctx, moduleInfoJSON) } +func (test *testLibrary) testSuiteInfo(ctx ModuleContext) { + test.testDecorator.testSuiteInfo(ctx) +} + func (test *testLibrary) installerProps() []interface{} { return append(test.baseInstaller.installerProps(), test.testDecorator.installerProps()...) } @@ -695,6 +709,12 @@ func (benchmark *benchmarkDecorator) moduleInfoJSON(ctx ModuleContext, moduleInf } } +func (benchmark *benchmarkDecorator) testSuiteInfo(ctx ModuleContext) { + android.SetProvider(ctx, android.TestSuiteInfoProvider, android.TestSuiteInfo{ + TestSuites: benchmark.Properties.Test_suites, + }) +} + func NewBenchmark(hod android.HostOrDeviceSupported) *Module { module, binary := newBinary(hod) module.multilib = android.MultilibBoth |