Add test for selects with variables am: b9519094d9

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3096217

Change-Id: Ia67752490a3cec0c8c8723c0655326131f4c4da9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cole Faust
2024-05-21 19:13:35 +00:00
committed by Automerger Merge Worker

View File

@@ -688,6 +688,29 @@ func TestSelects(t *testing.T) {
`, `,
expectedError: `can't assign select statement to non-configurable property "my_nonconfigurable_string_list"`, expectedError: `can't assign select statement to non-configurable property "my_nonconfigurable_string_list"`,
}, },
{
name: "Select in variable",
bp: `
my_second_variable = ["after.cpp"]
my_variable = select(soong_config_variable("my_namespace", "my_variable"), {
"a": ["a.cpp"],
"b": ["b.cpp"],
default: ["c.cpp"],
}) + my_second_variable
my_module_type {
name: "foo",
my_string_list: ["before.cpp"] + my_variable,
}
`,
provider: selectsTestProvider{
my_string_list: &[]string{"before.cpp", "a.cpp", "after.cpp"},
},
vendorVars: map[string]map[string]string{
"my_namespace": {
"my_variable": "a",
},
},
},
} }
for _, tc := range testCases { for _, tc := range testCases {