add unit test for bp2build allowlist
Test: go test ./android
Change-Id: I0ea1d97444cbedfd285f1fc4bd7ff246ce699dc9
diff --git a/bazel/properties_test.go b/bazel/properties_test.go
index c7f9776..7b76b74 100644
--- a/bazel/properties_test.go
+++ b/bazel/properties_test.go
@@ -329,7 +329,7 @@
func TestPartitionLabelListAttribute(t *testing.T) {
testCases := []struct {
name string
- ctx *otherModuleTestContext
+ ctx *OtherModuleTestContext
labelList LabelListAttribute
filters LabelPartitions
expected PartitionToLabelListAttribute
@@ -337,7 +337,7 @@
}{
{
name: "no configurable values",
- ctx: &otherModuleTestContext{},
+ ctx: &OtherModuleTestContext{},
labelList: LabelListAttribute{
Value: makeLabelList([]string{"a.a", "b.b", "c.c", "d.d", "e.e"}, []string{}),
},
@@ -354,7 +354,7 @@
},
{
name: "no configurable values, remainder partition",
- ctx: &otherModuleTestContext{},
+ ctx: &OtherModuleTestContext{},
labelList: LabelListAttribute{
Value: makeLabelList([]string{"a.a", "b.b", "c.c", "d.d", "e.e"}, []string{}),
},
@@ -371,7 +371,7 @@
},
{
name: "no configurable values, empty partition",
- ctx: &otherModuleTestContext{},
+ ctx: &OtherModuleTestContext{},
labelList: LabelListAttribute{
Value: makeLabelList([]string{"a.a", "c.c"}, []string{}),
},
@@ -387,8 +387,8 @@
},
{
name: "no configurable values, has map",
- ctx: &otherModuleTestContext{
- modules: []testModuleInfo{testModuleInfo{name: "srcs", typ: "fg", dir: "dir"}},
+ ctx: &OtherModuleTestContext{
+ Modules: []TestModuleInfo{{ModuleName: "srcs", Typ: "fg", Dir: "dir"}},
},
labelList: LabelListAttribute{
Value: makeLabelList([]string{"a.a", "srcs", "b.b", "c.c"}, []string{}),
@@ -406,7 +406,7 @@
},
{
name: "configurable values, keeps empty if excludes",
- ctx: &otherModuleTestContext{},
+ ctx: &OtherModuleTestContext{},
labelList: LabelListAttribute{
ConfigurableValues: configurableLabelLists{
ArchConfigurationAxis: labelListSelectValues{
@@ -450,7 +450,7 @@
},
{
name: "error for multiple partitions same value",
- ctx: &otherModuleTestContext{},
+ ctx: &OtherModuleTestContext{},
labelList: LabelListAttribute{
Value: makeLabelList([]string{"a.a", "b.b", "c.c", "d.d", "e.e"}, []string{}),
},