Allows specifying shared filegroup attributes in a central place. Test: filegroup_test.go Change-Id: I82feac37ae6998313a0004f8af58f3decf7a514e (cherry picked from https://android-review.googlesource.com/q/commit:7d6dd8bb3324e81b5c4afc80b062baad2fed1770) Merged-In: I82feac37ae6998313a0004f8af58f3decf7a514e
27 lines
604 B
Go
27 lines
604 B
Go
package android
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestFilegroupDefaults(t *testing.T) {
|
|
bp := FixtureAddTextFile("p/Android.bp", `
|
|
filegroup_defaults {
|
|
name: "defaults",
|
|
visibility: ["//x"],
|
|
}
|
|
filegroup {
|
|
name: "foo",
|
|
defaults: ["defaults"],
|
|
visibility: ["//y"],
|
|
}
|
|
`)
|
|
result := GroupFixturePreparers(
|
|
PrepareForTestWithFilegroup,
|
|
PrepareForTestWithDefaults,
|
|
PrepareForTestWithVisibility,
|
|
bp).RunTest(t)
|
|
rules := effectiveVisibilityRules(result.Config, qualifiedModuleName{pkg: "p", name: "foo"})
|
|
AssertDeepEquals(t, "visibility", []string{"//x", "//y"}, rules.Strings())
|
|
}
|