Add tests for request_type ParseResult functions.

Test: go test request_type_test
Test: bp2build generate & sync; mixed build libc
Change-Id: Id0b813e9de4d02d8625e42549999659ccb005c6d
This commit is contained in:
Liz Kammer
2021-04-09 16:17:05 -04:00
parent b71794d8e6
commit fe23bf3eb0
5 changed files with 116 additions and 15 deletions

View File

@@ -329,11 +329,14 @@ type prebuiltStaticLibraryBazelHandler struct {
func (h *prebuiltStaticLibraryBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool {
bazelCtx := ctx.Config().BazelContext
ccInfo, ok := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType)
staticLibs := ccInfo.CcStaticLibraryFiles
ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType)
if err != nil {
ctx.ModuleErrorf("Error getting Bazel CcInfo: %s", err)
}
if !ok {
return false
}
staticLibs := ccInfo.CcStaticLibraryFiles
if len(staticLibs) > 1 {
ctx.ModuleErrorf("expected 1 static library from bazel target %q, got %s", label, staticLibs)
return false