summaryrefslogtreecommitdiff
path: root/sdk/sdk_test.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2022-09-22 16:21:54 +0100
committer Paul Duffin <paulduffin@google.com> 2022-09-26 18:28:56 +0100
commitbfdca968288c930a8d717ceb76349c19bef42fd1 (patch)
treede6b7ecd2dad4ee5657e4b5f53bdf1b9bd234c08 /sdk/sdk_test.go
parent02e25c85eb32c337b3f8a2033c6c092b8fea91d3 (diff)
Add sdk:"keep" tag support
Fields tagged with `sdk:"keep"` will keep the value even if it would normally be cleared because it was common across a number of structs. This will allow a module type to specify the same value across all structs populated directly from variants and have it be copied into all common property structs without clearing it from the variant specific structs. Bug: 248258460 Test: m nothing Change-Id: I147d946b11fd8766a7d875d9206e8f5034f585d6
Diffstat (limited to 'sdk/sdk_test.go')
-rw-r--r--sdk/sdk_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go
index 4be1e79a4..2f9aee9da 100644
--- a/sdk/sdk_test.go
+++ b/sdk/sdk_test.go
@@ -221,6 +221,7 @@ type testPropertiesStruct struct {
name string
private string
Public_Ignore string `sdk:"ignore"`
+ Public_Keep string `sdk:"keep"`
S_Common string
S_Different string `android:"arch_variant"`
A_Common []string
@@ -247,6 +248,7 @@ func TestCommonValueOptimization(t *testing.T) {
name: "struct-0",
private: "common",
Public_Ignore: "common",
+ Public_Keep: "keep",
S_Common: "common",
S_Different: "upper",
A_Common: []string{"first", "second"},
@@ -262,6 +264,7 @@ func TestCommonValueOptimization(t *testing.T) {
name: "struct-1",
private: "common",
Public_Ignore: "common",
+ Public_Keep: "keep",
S_Common: "common",
S_Different: "lower",
A_Common: []string{"first", "second"},
@@ -285,6 +288,7 @@ func TestCommonValueOptimization(t *testing.T) {
name: "common",
private: "",
Public_Ignore: "",
+ Public_Keep: "keep",
S_Common: "common",
S_Different: "",
A_Common: []string{"first", "second"},
@@ -303,6 +307,7 @@ func TestCommonValueOptimization(t *testing.T) {
name: "struct-0",
private: "common",
Public_Ignore: "common",
+ Public_Keep: "keep",
S_Common: "",
S_Different: "upper",
A_Common: nil,
@@ -321,6 +326,7 @@ func TestCommonValueOptimization(t *testing.T) {
name: "struct-1",
private: "common",
Public_Ignore: "common",
+ Public_Keep: "keep",
S_Common: "",
S_Different: "lower",
A_Common: nil,