Create a bp2build converter for ndk_headers

And add this module type to alwaysConvertList

Test: go test ./bp2build
Bug: 300504837
Change-Id: Ic09738ab47e7c497287b73de0f952d52aa78dd17
This commit is contained in:
Spandan Das
2023-09-19 19:04:41 +00:00
parent e993475ca6
commit 319711b0bc
5 changed files with 57 additions and 3 deletions

View File

@@ -5184,3 +5184,30 @@ ndk_library {
}
runCcLibraryTestCase(t, tc)
}
func TestNdkHeadersConversion(t *testing.T) {
tc := Bp2buildTestCase{
Description: "ndk_headers conversion",
ModuleTypeUnderTest: "ndk_headers",
ModuleTypeUnderTestFactory: cc.NdkHeadersFactory,
Blueprint: `
ndk_headers {
name: "libfoo_headers",
from: "from",
to: "to",
srcs: ["foo.h", "foo_other.h"]
}
`,
ExpectedBazelTargets: []string{
MakeBazelTargetNoRestrictions("ndk_headers", "libfoo_headers", AttrNameToString{
"strip_import_prefix": `"from"`,
"import_prefix": `"to"`,
"hdrs": `[
"foo.h",
"foo_other.h",
]`,
}),
},
}
runCcLibraryTestCase(t, tc)
}