summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2022-09-26 22:48:45 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-09-26 22:48:45 +0000
commit018dcfce20fbb0ee5275e3795b0bae768d9ace1a (patch)
treea13dcdde7e5815f2dfd88c136d76b7c0f4287526
parent638ae72b3a6a7d89f5ba30d7ed1ff2d931c55dda (diff)
parent808bc719b9833d6f0a27830f37c062691186b5ea (diff)
Merge "Unit test for missing module error"
-rw-r--r--bp2build/build_conversion_test.go25
1 files changed, 23 insertions, 2 deletions
diff --git a/bp2build/build_conversion_test.go b/bp2build/build_conversion_test.go
index 10a13bf4e..d29eb9cd3 100644
--- a/bp2build/build_conversion_test.go
+++ b/bp2build/build_conversion_test.go
@@ -1053,6 +1053,29 @@ func TestModuleTypeBp2Build(t *testing.T) {
}`,
},
},
+ {
+ 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 {
@@ -1062,8 +1085,6 @@ func TestModuleTypeBp2Build(t *testing.T) {
}
}
-type bp2buildMutator = func(android.TopDownMutatorContext)
-
func TestAllowlistingBp2buildTargetsExplicitly(t *testing.T) {
testCases := []struct {
moduleTypeUnderTest string