Merge "Rename vndk apex according to vndk version"

This commit is contained in:
Treehugger Robot
2019-10-07 04:44:45 +00:00
committed by Gerrit Code Review
2 changed files with 44 additions and 2 deletions

View File

@@ -1442,6 +1442,37 @@ func TestVndkApexErrorWithDuplicateVersion(t *testing.T) {
}))
}
func TestVndkApexNameRule(t *testing.T) {
ctx, _ := testApex(t, `
apex_vndk {
name: "myapex",
key: "myapex.key",
file_contexts: "myapex",
}
apex_vndk {
name: "myapex_v28",
key: "myapex.key",
file_contexts: "myapex",
vndk_version: "28",
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}`)
assertApexName := func(expected, moduleName string) {
bundle := ctx.ModuleForTests(moduleName, "android_common_"+moduleName).Module().(*apexBundle)
actual := proptools.String(bundle.properties.Apex_name)
if !reflect.DeepEqual(actual, expected) {
t.Errorf("Got '%v', expected '%v'", actual, expected)
}
}
assertApexName("com.android.vndk.vVER", "myapex")
assertApexName("com.android.vndk.v28", "myapex_v28")
}
func TestVndkApexSkipsNativeBridgeSupportedModules(t *testing.T) {
ctx, _ := testApex(t, `
apex_vndk {