summaryrefslogtreecommitdiff
path: root/android/config_test.go
diff options
context:
space:
mode:
author LaMont Jones <lamontjones@google.com> 2024-06-11 11:28:54 -0700
committer LaMont Jones <lamontjones@google.com> 2024-06-18 17:16:42 -0700
commit21d04d99c8153b8ec1e63ff6a463e7fdd1d14386 (patch)
tree4c7ceec3939fd4db458ad2b2e02cedee9f2d9676 /android/config_test.go
parentecdb25e6747f05ce65529603443aeff91387f8e4 (diff)
Add RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS
This build flag causes us to create aconfig flag artifacts for the given extra release configs. Bug: 298444886 Test: manual Change-Id: I10148f6e7318b0477438ed1d8baafbf4dc594c90
Diffstat (limited to 'android/config_test.go')
-rw-r--r--android/config_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/android/config_test.go b/android/config_test.go
index 7d327a27e..ca7c7f8b4 100644
--- a/android/config_test.go
+++ b/android/config_test.go
@@ -125,6 +125,43 @@ func assertStringEquals(t *testing.T, expected, actual string) {
}
}
+func TestReleaseAconfigExtraReleaseConfigs(t *testing.T) {
+ testCases := []struct {
+ name string
+ flag string
+ expected []string
+ }{
+ {
+ name: "empty",
+ flag: "",
+ expected: []string{},
+ },
+ {
+ name: "specified",
+ flag: "bar foo",
+ expected: []string{"bar", "foo"},
+ },
+ {
+ name: "duplicates",
+ flag: "foo bar foo",
+ expected: []string{"foo", "bar"},
+ },
+ }
+
+ for _, tc := range testCases {
+ fixture := GroupFixturePreparers(
+ FixtureModifyProductVariables(func(vars FixtureProductVariables) {
+ if vars.BuildFlags == nil {
+ vars.BuildFlags = make(map[string]string)
+ }
+ vars.BuildFlags["RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS"] = tc.flag
+ }),
+ )
+ actual := fixture.RunTest(t).Config.ReleaseAconfigExtraReleaseConfigs()
+ AssertArrayString(t, tc.name, tc.expected, actual)
+ }
+}
+
func TestConfiguredJarList(t *testing.T) {
list1 := CreateTestConfiguredJarList([]string{"apex1:jarA"})