Merge "Unit test for missing module error"

This commit is contained in:
Treehugger Robot
2022-09-26 22:48:45 +00:00
committed by Gerrit Code Review

View File

@@ -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