summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index ced3c46d5..a03bb4492 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -10165,9 +10165,9 @@ func TestStubLibrariesMultipleApexViolation(t *testing.T) {
expectedError: "Stub libraries should have a single apex_available.*myapex.*otherapex",
},
{
- desc: "stub library can be available to a core apex and a test apex",
+ desc: "stub library can be available to a core apex and a test apex using apex_available_name",
hasStubs: true,
- apexAvailable: `["myapex", "test_myapex"]`,
+ apexAvailable: `["myapex"]`,
},
}
bpTemplate := `
@@ -10192,25 +10192,28 @@ func TestStubLibrariesMultipleApexViolation(t *testing.T) {
key: "apex.key",
updatable: false,
native_shared_libs: ["libfoo"],
+ apex_available_name: "myapex",
}
apex_key {
name: "apex.key",
}
`
for _, tc := range testCases {
- stubs := ""
- if tc.hasStubs {
- stubs = `stubs: {symbol_file: "libfoo.map.txt"},`
- }
- bp := fmt.Sprintf(bpTemplate, stubs, tc.apexAvailable)
- mockFsFixturePreparer := android.FixtureModifyMockFS(func(fs android.MockFS) {
- fs["system/sepolicy/apex/test_myapex-file_contexts"] = nil
+ t.Run(tc.desc, func(t *testing.T) {
+ stubs := ""
+ if tc.hasStubs {
+ stubs = `stubs: {symbol_file: "libfoo.map.txt"},`
+ }
+ bp := fmt.Sprintf(bpTemplate, stubs, tc.apexAvailable)
+ mockFsFixturePreparer := android.FixtureModifyMockFS(func(fs android.MockFS) {
+ fs["system/sepolicy/apex/test_myapex-file_contexts"] = nil
+ })
+ if tc.expectedError == "" {
+ testApex(t, bp, mockFsFixturePreparer)
+ } else {
+ testApexError(t, tc.expectedError, bp, mockFsFixturePreparer)
+ }
})
- if tc.expectedError == "" {
- testApex(t, bp, mockFsFixturePreparer)
- } else {
- testApexError(t, tc.expectedError, bp, mockFsFixturePreparer)
- }
}
}