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
diff --git a/cc/test.go b/cc/test.go
index 1085d3a..f51cf01 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -29,6 +29,11 @@
// if set, use the isolated gtest runner. Defaults to false.
Isolated *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.
+ Test_for []string
}
// Test option struct.
@@ -215,6 +220,10 @@
return BoolDefault(test.Properties.Gtest, true)
}
+func (test *testDecorator) testFor() []string {
+ return test.Properties.Test_for
+}
+
func (test *testDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
if !test.gtest() {
return flags