Add test_for property

This change adds 'test_for' property to cc_test_* types. The property is
used to mark a module as a test for one or more APEXes, in which case
the module has accecss to the private part of the listed APEXes. For
example, the module is linked with the actrual shared library in the
APEX instead of the stub of the shared library.

Exempt-From-Owner-Approval: already +2'ed by owner

Bug: 129539670
Bug: 153046163
Test: m
Change-Id: I45ed0d7a15540b0d69b2a3b8d9c4cb202adff6f2
This commit is contained in:
Jiyong Park
2020-04-13 16:19:48 +09:00
parent 96447be640
commit 62304bbeec
4 changed files with 90 additions and 0 deletions

View File

@@ -108,6 +108,11 @@ type ApexModule interface {
// Tests if the module comes from an updatable APEX.
Updatable() bool
// List of APEXes that this module tests. The module has access to
// the private part of the listed APEXes even when it is not included in the
// APEXes.
TestFor() []string
}
type ApexProperties struct {
@@ -151,6 +156,11 @@ func (m *ApexModuleBase) ApexAvailable() []string {
return m.ApexProperties.Apex_available
}
func (m *ApexModuleBase) TestFor() []string {
// To be implemented by concrete types inheriting ApexModuleBase
return nil
}
func (m *ApexModuleBase) BuildForApexes(apexes []ApexInfo) {
m.apexVariationsLock.Lock()
defer m.apexVariationsLock.Unlock()