summaryrefslogtreecommitdiff
path: root/android/path_properties_test.go
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2021-02-24 01:22:57 +0900
committer Jiyong Park <jiyong@google.com> 2021-02-24 01:22:57 +0900
commit66dd5c09e2d77b19030c13f4028ad7f649514d29 (patch)
tree6dddbe536b25c075f4f5e424f73e2a6ecd400a74 /android/path_properties_test.go
parent0d2497088c0380d72b66ae44e3a82a755fc247ab (diff)
android:path attribute is respected for fields in a slice of struct
This change fixes a bug that android:path attribute is ignored when annotated field is in a slice of struct. blueprint now traverses fields whose type is slice of struct and provides the index list in the case. Soong is modified so that it checks whether the field being referenced is a slice of struct or not. If that is the case, it gathers field values from each of the elements. If not, it follows the original path. Bug: 181018147 Test: m nothing Change-Id: I220efb6feaa525a00939654459b2998e98e7ad56
Diffstat (limited to 'android/path_properties_test.go')
-rw-r--r--android/path_properties_test.go37
1 files changed, 35 insertions, 2 deletions
diff --git a/android/path_properties_test.go b/android/path_properties_test.go
index f964d9f1e..2aab74835 100644
--- a/android/path_properties_test.go
+++ b/android/path_properties_test.go
@@ -33,12 +33,21 @@ type pathDepsMutatorTestModule struct {
Foo string `android:"path"`
}
+ // nested slices of struct
+ props3 struct {
+ X []struct {
+ Y []struct {
+ Z []string `android:"path"`
+ }
+ }
+ }
+
sourceDeps []string
}
func pathDepsMutatorTestModuleFactory() Module {
module := &pathDepsMutatorTestModule{}
- module.AddProperties(&module.props, &module.props2)
+ module.AddProperties(&module.props, &module.props2, &module.props3)
InitAndroidArchModule(module, DeviceSupported, MultilibBoth)
return module
}
@@ -73,8 +82,20 @@ func TestPathDepsMutator(t *testing.T) {
bar: [":b"],
baz: ":c{.bar}",
qux: ":d",
+ x: [
+ {
+ y: [
+ {
+ z: [":x", ":y"],
+ },
+ {
+ z: [":z"],
+ },
+ ],
+ },
+ ],
}`,
- deps: []string{"a", "b", "c"},
+ deps: []string{"a", "b", "c", "x", "y", "z"},
},
{
name: "arch variant",
@@ -113,6 +134,18 @@ func TestPathDepsMutator(t *testing.T) {
filegroup {
name: "d",
}
+
+ filegroup {
+ name: "x",
+ }
+
+ filegroup {
+ name: "y",
+ }
+
+ filegroup {
+ name: "z",
+ }
`
config := TestArchConfig(buildDir, nil, bp, nil)