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
This commit is contained in:
Usta Shrestha
2022-09-23 23:18:18 -04:00
committed by Usta (Tsering) Shrestha
parent 7574afb67f
commit 808bc719b9

View File

@@ -1035,6 +1035,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 {
@@ -1044,8 +1067,6 @@ func TestModuleTypeBp2Build(t *testing.T) {
}
}
type bp2buildMutator = func(android.TopDownMutatorContext)
func TestAllowlistingBp2buildTargetsExplicitly(t *testing.T) {
testCases := []struct {
moduleTypeUnderTest string