Unit test for missing module error
build_conversion handling of missing module
Bug: N/A
Test: unit test build_conversion_test.go
Change-Id: I636b7228040294d354bf2add050babe66fc25cce
diff --git a/bp2build/build_conversion_test.go b/bp2build/build_conversion_test.go
index 9f4f7c1..7bd3112 100644
--- a/bp2build/build_conversion_test.go
+++ b/bp2build/build_conversion_test.go
@@ -1035,6 +1035,29 @@
}`,
},
},
+ {
+ Description: "depends_on_other_missing_module_error",
+ ModuleTypeUnderTest: "filegroup",
+ ModuleTypeUnderTestFactory: android.FileGroupFactory,
+ UnconvertedDepsMode: errorModulesUnconvertedDeps,
+ Blueprint: `filegroup {
+ name: "foobar",
+ srcs: [
+ "c",
+ "//other:foo",
+ "//other:goo",
+ ],
+ bazel_module: { bp2build_available: true },
+}`,
+ ExpectedErr: fmt.Errorf(`filegroup .:foobar depends on missing modules: //other:goo`),
+ Filesystem: map[string]string{"other/Android.bp": `filegroup {
+ name: "foo",
+ srcs: ["a"],
+ bazel_module: { bp2build_available: true },
+}
+`,
+ },
+ },
}
for _, testCase := range testCases {
@@ -1044,8 +1067,6 @@
}
}
-type bp2buildMutator = func(android.TopDownMutatorContext)
-
func TestAllowlistingBp2buildTargetsExplicitly(t *testing.T) {
testCases := []struct {
moduleTypeUnderTest string