mixed builds correctly reference stubs libs

Bug: 270408757
Test: go test
Test: m NeuralNetworksTest_shared_partial --bazel-mode-staging
  && verify that Ninja commands link libneuralnetworks via stubs
Change-Id: I19bf5a829cea7fd00c0f82511ad2bddbc40fae4f
This commit is contained in:
Sam Delmerico
2023-04-10 17:19:51 -04:00
parent 2a1de1bfe6
commit ca438e6b72
6 changed files with 201 additions and 13 deletions

View File

@@ -1249,3 +1249,40 @@ cc_library_shared {
},
})
}
func TestCcLibrarySharedStubsDessertVersionConversion(t *testing.T) {
runCcLibrarySharedTestCase(t, Bp2buildTestCase{
Description: "cc_library_shared converts dessert codename versions to numerical versions",
Blueprint: `
cc_library_shared {
name: "a",
include_build_directory: false,
stubs: {
symbol_file: "a.map.txt",
versions: [
"Q",
"R",
"31",
"current",
],
},
}
`,
ExpectedBazelTargets: []string{
makeCcStubSuiteTargets("a", AttrNameToString{
"soname": `"a.so"`,
"source_library_label": `"//:a"`,
"stubs_symbol_file": `"a.map.txt"`,
"stubs_versions": `[
"29",
"30",
"31",
"current",
]`,
}),
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"stubs_symbol_file": `"a.map.txt"`,
}),
},
})
}