Loading android/config.go +1 −1 Original line number Diff line number Diff line Loading @@ -552,7 +552,7 @@ func (c *config) mockFileSystem(bp string, fs map[string][]byte) { pathsToParse := []string{} for candidate := range mockFS { base := filepath.Base(candidate) if base == "Blueprints" || base == "Android.bp" { if base == "Android.bp" { pathsToParse = append(pathsToParse, candidate) } } Loading android/license_kind_test.go +9 −9 Original line number Diff line number Diff line Loading @@ -14,38 +14,38 @@ var licenseKindTests = []struct { { name: "license_kind must not accept licenses property", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_license", licenses: ["other_license"], }`), }, expectedErrors: []string{ `top/Blueprints:4:14: unrecognized property "licenses"`, `top/Android.bp:4:14: unrecognized property "licenses"`, }, }, { name: "bad license_kind", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_license { name: "other_notice", license_kinds: ["notice"], }`), }, expectedErrors: []string{ `other/Blueprints:2:5: "other_notice" depends on undefined module "notice"`, `other/Android.bp:2:5: "other_notice" depends on undefined module "notice"`, }, }, { name: "good license kind", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_by_exception_only", conditions: ["by_exception_only"], Loading @@ -55,7 +55,7 @@ var licenseKindTests = []struct { name: "top_proprietary", license_kinds: ["top_by_exception_only"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_license { name: "other_proprietary", license_kinds: ["top_proprietary"], Loading @@ -65,7 +65,7 @@ var licenseKindTests = []struct { { name: "multiple license kinds", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], Loading @@ -85,7 +85,7 @@ var licenseKindTests = []struct { name: "top_proprietary", license_kinds: ["top_by_exception_only"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_license { name: "other_rule", license_kinds: ["top_by_exception_only"], Loading android/license_test.go +17 −17 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ var licenseTests = []struct { { name: "license must not accept licenses property", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license { name: "top_license", visibility: ["//visibility:private"], Loading @@ -35,13 +35,13 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:5:14: unrecognized property "licenses"`, `top/Android.bp:5:14: unrecognized property "licenses"`, }, }, { name: "private license", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], Loading @@ -53,27 +53,27 @@ var licenseTests = []struct { license_kinds: ["top_notice"], visibility: ["//visibility:private"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` rule { name: "arule", licenses: ["top_allowed_as_notice"], }`), "yetmore/Blueprints": []byte(` "yetmore/Android.bp": []byte(` package { default_applicable_licenses: ["top_allowed_as_notice"], }`), }, expectedErrors: []string{ `other/Blueprints:2:5: module "arule": depends on //top:top_allowed_as_notice ` + `other/Android.bp:2:5: module "arule": depends on //top:top_allowed_as_notice ` + `which is not visible to this module`, `yetmore/Blueprints:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` + `yetmore/Android.bp:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` + `which is not visible to this module`, }, }, { name: "must reference license_kind module", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` rule { name: "top_by_exception_only", } Loading @@ -85,14 +85,14 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:6:5: module "top_proprietary": license_kinds property ` + `top/Android.bp:6:5: module "top_proprietary": license_kinds property ` + `"top_by_exception_only" is not a license_kind module`, }, }, { name: "license_kind module must exist", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license { name: "top_notice_allowed", license_kinds: ["top_notice"], Loading @@ -100,13 +100,13 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:2:5: "top_notice_allowed" depends on undefined module "top_notice"`, `top/Android.bp:2:5: "top_notice_allowed" depends on undefined module "top_notice"`, }, }, { name: "public license", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_by_exception_only", conditions: ["by_exception_only"], Loading @@ -118,12 +118,12 @@ var licenseTests = []struct { license_kinds: ["top_by_exception_only"], visibility: ["//visibility:public"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` rule { name: "arule", licenses: ["top_proprietary"], }`), "yetmore/Blueprints": []byte(` "yetmore/Android.bp": []byte(` package { default_applicable_licenses: ["top_proprietary"], }`), Loading @@ -132,7 +132,7 @@ var licenseTests = []struct { { name: "multiple licenses", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["top_proprietary"], } Loading Loading @@ -162,12 +162,12 @@ var licenseTests = []struct { name: "myrule", licenses: ["top_allowed_as_notice", "top_proprietary"] }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` rule { name: "arule", licenses: ["top_proprietary"], }`), "yetmore/Blueprints": []byte(` "yetmore/Android.bp": []byte(` package { default_applicable_licenses: ["top_proprietary"], }`), Loading android/licenses_test.go +27 −27 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ var licensesTests = []struct { { name: "invalid module type without licenses property", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` mock_bad_module { name: "libexample", }`), Loading @@ -30,7 +30,7 @@ var licensesTests = []struct { { name: "license must exist", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` mock_library { name: "libexample", licenses: ["notice"], Loading @@ -41,7 +41,7 @@ var licensesTests = []struct { { name: "all good", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "notice", conditions: ["shownotice"], Loading @@ -58,12 +58,12 @@ var licensesTests = []struct { name: "libexample1", licenses: ["top_Apache2"], }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` mock_library { name: "libnested", licenses: ["top_Apache2"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_library { name: "libother", licenses: ["top_Apache2"], Loading Loading @@ -101,7 +101,7 @@ var licensesTests = []struct { // Check that licenses is the union of the defaults modules. name: "defaults union, basic", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], Loading @@ -125,7 +125,7 @@ var licensesTests = []struct { name: "libsamepackage", deps: ["libexample"], }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` license_kind { name: "nested_notice", conditions: ["notice"], Loading @@ -140,7 +140,7 @@ var licensesTests = []struct { name: "libnested", deps: ["libexample"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_library { name: "libother", deps: ["libexample"], Loading Loading @@ -174,7 +174,7 @@ var licensesTests = []struct { { name: "defaults union, multiple defaults", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license { name: "top", } Loading @@ -194,7 +194,7 @@ var licensesTests = []struct { name: "libsamepackage", deps: ["libexample"], }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` license { name: "top_nested", license_text: ["LICENSE.txt"], Loading @@ -203,7 +203,7 @@ var licensesTests = []struct { name: "libnested", deps: ["libexample"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` license { name: "other", } Loading @@ -211,7 +211,7 @@ var licensesTests = []struct { name: "libother", deps: ["libexample"], }`), "outsider/Blueprints": []byte(` "outsider/Android.bp": []byte(` mock_library { name: "liboutsider", deps: ["libexample"], Loading Loading @@ -251,7 +251,7 @@ var licensesTests = []struct { { name: "defaults_licenses invalid", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` mock_defaults { name: "top_defaults", licenses: ["notice"], Loading @@ -262,7 +262,7 @@ var licensesTests = []struct { { name: "defaults_licenses overrides package default", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["by_exception_only"], } Loading Loading @@ -298,7 +298,7 @@ var licensesTests = []struct { { name: "package default_applicable_licenses must exist", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["notice"], }`), Loading @@ -309,7 +309,7 @@ var licensesTests = []struct { // This test relies on the default licenses being legacy_public. name: "package default_applicable_licenses property used when no licenses specified", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["top_notice"], } Loading @@ -320,7 +320,7 @@ var licensesTests = []struct { mock_library { name: "libexample", }`), "outsider/Blueprints": []byte(` "outsider/Android.bp": []byte(` mock_library { name: "liboutsider", deps: ["libexample"], Loading @@ -338,7 +338,7 @@ var licensesTests = []struct { { name: "package default_applicable_licenses not inherited to subpackages", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["top_notice"], } Loading @@ -348,7 +348,7 @@ var licensesTests = []struct { mock_library { name: "libexample", }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` package { default_applicable_licenses: ["outsider"], } Loading @@ -356,11 +356,11 @@ var licensesTests = []struct { mock_library { name: "libnested", }`), "top/other/Blueprints": []byte(` "top/other/Android.bp": []byte(` mock_library { name: "libother", }`), "outsider/Blueprints": []byte(` "outsider/Android.bp": []byte(` license { name: "outsider", } Loading @@ -385,7 +385,7 @@ var licensesTests = []struct { { name: "verify that prebuilt dependencies are included", fs: map[string][]byte{ "prebuilts/Blueprints": []byte(` "prebuilts/Android.bp": []byte(` license { name: "prebuilt" } Loading @@ -394,7 +394,7 @@ var licensesTests = []struct { licenses: ["prebuilt"], }`), "top/sources/source_file": nil, "top/sources/Blueprints": []byte(` "top/sources/Android.bp": []byte(` license { name: "top_sources" } Loading @@ -403,7 +403,7 @@ var licensesTests = []struct { licenses: ["top_sources"], }`), "top/other/source_file": nil, "top/other/Blueprints": []byte(` "top/other/Android.bp": []byte(` source { name: "other", deps: [":module"], Loading @@ -419,7 +419,7 @@ var licensesTests = []struct { { name: "verify that prebuilt dependencies are ignored for licenses reasons (preferred)", fs: map[string][]byte{ "prebuilts/Blueprints": []byte(` "prebuilts/Android.bp": []byte(` license { name: "prebuilt" } Loading @@ -429,7 +429,7 @@ var licensesTests = []struct { prefer: true, }`), "top/sources/source_file": nil, "top/sources/Blueprints": []byte(` "top/sources/Android.bp": []byte(` license { name: "top_sources" } Loading @@ -438,7 +438,7 @@ var licensesTests = []struct { licenses: ["top_sources"], }`), "top/other/source_file": nil, "top/other/Blueprints": []byte(` "top/other/Android.bp": []byte(` source { name: "other", deps: [":module"], Loading android/package_test.go +8 −8 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ var packageTests = []struct { { name: "package must not accept visibility and name properties", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { name: "package", visibility: ["//visibility:private"], Loading @@ -21,21 +21,21 @@ var packageTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:5:14: unrecognized property "licenses"`, `top/Blueprints:3:10: unrecognized property "name"`, `top/Blueprints:4:16: unrecognized property "visibility"`, `top/Android.bp:5:14: unrecognized property "licenses"`, `top/Android.bp:3:10: unrecognized property "name"`, `top/Android.bp:4:16: unrecognized property "visibility"`, }, }, { name: "multiple packages in separate directories", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` package { }`), "other/nested/Blueprints": []byte(` "other/nested/Android.bp": []byte(` package { }`), }, Loading @@ -43,7 +43,7 @@ var packageTests = []struct { { name: "package must not be specified more than once per package", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_visibility: ["//visibility:private"], default_applicable_licenses: ["license"], Loading Loading
android/config.go +1 −1 Original line number Diff line number Diff line Loading @@ -552,7 +552,7 @@ func (c *config) mockFileSystem(bp string, fs map[string][]byte) { pathsToParse := []string{} for candidate := range mockFS { base := filepath.Base(candidate) if base == "Blueprints" || base == "Android.bp" { if base == "Android.bp" { pathsToParse = append(pathsToParse, candidate) } } Loading
android/license_kind_test.go +9 −9 Original line number Diff line number Diff line Loading @@ -14,38 +14,38 @@ var licenseKindTests = []struct { { name: "license_kind must not accept licenses property", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_license", licenses: ["other_license"], }`), }, expectedErrors: []string{ `top/Blueprints:4:14: unrecognized property "licenses"`, `top/Android.bp:4:14: unrecognized property "licenses"`, }, }, { name: "bad license_kind", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_license { name: "other_notice", license_kinds: ["notice"], }`), }, expectedErrors: []string{ `other/Blueprints:2:5: "other_notice" depends on undefined module "notice"`, `other/Android.bp:2:5: "other_notice" depends on undefined module "notice"`, }, }, { name: "good license kind", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_by_exception_only", conditions: ["by_exception_only"], Loading @@ -55,7 +55,7 @@ var licenseKindTests = []struct { name: "top_proprietary", license_kinds: ["top_by_exception_only"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_license { name: "other_proprietary", license_kinds: ["top_proprietary"], Loading @@ -65,7 +65,7 @@ var licenseKindTests = []struct { { name: "multiple license kinds", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], Loading @@ -85,7 +85,7 @@ var licenseKindTests = []struct { name: "top_proprietary", license_kinds: ["top_by_exception_only"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_license { name: "other_rule", license_kinds: ["top_by_exception_only"], Loading
android/license_test.go +17 −17 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ var licenseTests = []struct { { name: "license must not accept licenses property", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license { name: "top_license", visibility: ["//visibility:private"], Loading @@ -35,13 +35,13 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:5:14: unrecognized property "licenses"`, `top/Android.bp:5:14: unrecognized property "licenses"`, }, }, { name: "private license", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], Loading @@ -53,27 +53,27 @@ var licenseTests = []struct { license_kinds: ["top_notice"], visibility: ["//visibility:private"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` rule { name: "arule", licenses: ["top_allowed_as_notice"], }`), "yetmore/Blueprints": []byte(` "yetmore/Android.bp": []byte(` package { default_applicable_licenses: ["top_allowed_as_notice"], }`), }, expectedErrors: []string{ `other/Blueprints:2:5: module "arule": depends on //top:top_allowed_as_notice ` + `other/Android.bp:2:5: module "arule": depends on //top:top_allowed_as_notice ` + `which is not visible to this module`, `yetmore/Blueprints:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` + `yetmore/Android.bp:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` + `which is not visible to this module`, }, }, { name: "must reference license_kind module", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` rule { name: "top_by_exception_only", } Loading @@ -85,14 +85,14 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:6:5: module "top_proprietary": license_kinds property ` + `top/Android.bp:6:5: module "top_proprietary": license_kinds property ` + `"top_by_exception_only" is not a license_kind module`, }, }, { name: "license_kind module must exist", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license { name: "top_notice_allowed", license_kinds: ["top_notice"], Loading @@ -100,13 +100,13 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:2:5: "top_notice_allowed" depends on undefined module "top_notice"`, `top/Android.bp:2:5: "top_notice_allowed" depends on undefined module "top_notice"`, }, }, { name: "public license", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_by_exception_only", conditions: ["by_exception_only"], Loading @@ -118,12 +118,12 @@ var licenseTests = []struct { license_kinds: ["top_by_exception_only"], visibility: ["//visibility:public"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` rule { name: "arule", licenses: ["top_proprietary"], }`), "yetmore/Blueprints": []byte(` "yetmore/Android.bp": []byte(` package { default_applicable_licenses: ["top_proprietary"], }`), Loading @@ -132,7 +132,7 @@ var licenseTests = []struct { { name: "multiple licenses", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["top_proprietary"], } Loading Loading @@ -162,12 +162,12 @@ var licenseTests = []struct { name: "myrule", licenses: ["top_allowed_as_notice", "top_proprietary"] }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` rule { name: "arule", licenses: ["top_proprietary"], }`), "yetmore/Blueprints": []byte(` "yetmore/Android.bp": []byte(` package { default_applicable_licenses: ["top_proprietary"], }`), Loading
android/licenses_test.go +27 −27 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ var licensesTests = []struct { { name: "invalid module type without licenses property", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` mock_bad_module { name: "libexample", }`), Loading @@ -30,7 +30,7 @@ var licensesTests = []struct { { name: "license must exist", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` mock_library { name: "libexample", licenses: ["notice"], Loading @@ -41,7 +41,7 @@ var licensesTests = []struct { { name: "all good", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "notice", conditions: ["shownotice"], Loading @@ -58,12 +58,12 @@ var licensesTests = []struct { name: "libexample1", licenses: ["top_Apache2"], }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` mock_library { name: "libnested", licenses: ["top_Apache2"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_library { name: "libother", licenses: ["top_Apache2"], Loading Loading @@ -101,7 +101,7 @@ var licensesTests = []struct { // Check that licenses is the union of the defaults modules. name: "defaults union, basic", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license_kind { name: "top_notice", conditions: ["notice"], Loading @@ -125,7 +125,7 @@ var licensesTests = []struct { name: "libsamepackage", deps: ["libexample"], }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` license_kind { name: "nested_notice", conditions: ["notice"], Loading @@ -140,7 +140,7 @@ var licensesTests = []struct { name: "libnested", deps: ["libexample"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` mock_library { name: "libother", deps: ["libexample"], Loading Loading @@ -174,7 +174,7 @@ var licensesTests = []struct { { name: "defaults union, multiple defaults", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` license { name: "top", } Loading @@ -194,7 +194,7 @@ var licensesTests = []struct { name: "libsamepackage", deps: ["libexample"], }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` license { name: "top_nested", license_text: ["LICENSE.txt"], Loading @@ -203,7 +203,7 @@ var licensesTests = []struct { name: "libnested", deps: ["libexample"], }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` license { name: "other", } Loading @@ -211,7 +211,7 @@ var licensesTests = []struct { name: "libother", deps: ["libexample"], }`), "outsider/Blueprints": []byte(` "outsider/Android.bp": []byte(` mock_library { name: "liboutsider", deps: ["libexample"], Loading Loading @@ -251,7 +251,7 @@ var licensesTests = []struct { { name: "defaults_licenses invalid", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` mock_defaults { name: "top_defaults", licenses: ["notice"], Loading @@ -262,7 +262,7 @@ var licensesTests = []struct { { name: "defaults_licenses overrides package default", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["by_exception_only"], } Loading Loading @@ -298,7 +298,7 @@ var licensesTests = []struct { { name: "package default_applicable_licenses must exist", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["notice"], }`), Loading @@ -309,7 +309,7 @@ var licensesTests = []struct { // This test relies on the default licenses being legacy_public. name: "package default_applicable_licenses property used when no licenses specified", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["top_notice"], } Loading @@ -320,7 +320,7 @@ var licensesTests = []struct { mock_library { name: "libexample", }`), "outsider/Blueprints": []byte(` "outsider/Android.bp": []byte(` mock_library { name: "liboutsider", deps: ["libexample"], Loading @@ -338,7 +338,7 @@ var licensesTests = []struct { { name: "package default_applicable_licenses not inherited to subpackages", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_applicable_licenses: ["top_notice"], } Loading @@ -348,7 +348,7 @@ var licensesTests = []struct { mock_library { name: "libexample", }`), "top/nested/Blueprints": []byte(` "top/nested/Android.bp": []byte(` package { default_applicable_licenses: ["outsider"], } Loading @@ -356,11 +356,11 @@ var licensesTests = []struct { mock_library { name: "libnested", }`), "top/other/Blueprints": []byte(` "top/other/Android.bp": []byte(` mock_library { name: "libother", }`), "outsider/Blueprints": []byte(` "outsider/Android.bp": []byte(` license { name: "outsider", } Loading @@ -385,7 +385,7 @@ var licensesTests = []struct { { name: "verify that prebuilt dependencies are included", fs: map[string][]byte{ "prebuilts/Blueprints": []byte(` "prebuilts/Android.bp": []byte(` license { name: "prebuilt" } Loading @@ -394,7 +394,7 @@ var licensesTests = []struct { licenses: ["prebuilt"], }`), "top/sources/source_file": nil, "top/sources/Blueprints": []byte(` "top/sources/Android.bp": []byte(` license { name: "top_sources" } Loading @@ -403,7 +403,7 @@ var licensesTests = []struct { licenses: ["top_sources"], }`), "top/other/source_file": nil, "top/other/Blueprints": []byte(` "top/other/Android.bp": []byte(` source { name: "other", deps: [":module"], Loading @@ -419,7 +419,7 @@ var licensesTests = []struct { { name: "verify that prebuilt dependencies are ignored for licenses reasons (preferred)", fs: map[string][]byte{ "prebuilts/Blueprints": []byte(` "prebuilts/Android.bp": []byte(` license { name: "prebuilt" } Loading @@ -429,7 +429,7 @@ var licensesTests = []struct { prefer: true, }`), "top/sources/source_file": nil, "top/sources/Blueprints": []byte(` "top/sources/Android.bp": []byte(` license { name: "top_sources" } Loading @@ -438,7 +438,7 @@ var licensesTests = []struct { licenses: ["top_sources"], }`), "top/other/source_file": nil, "top/other/Blueprints": []byte(` "top/other/Android.bp": []byte(` source { name: "other", deps: [":module"], Loading
android/package_test.go +8 −8 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ var packageTests = []struct { { name: "package must not accept visibility and name properties", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { name: "package", visibility: ["//visibility:private"], Loading @@ -21,21 +21,21 @@ var packageTests = []struct { }`), }, expectedErrors: []string{ `top/Blueprints:5:14: unrecognized property "licenses"`, `top/Blueprints:3:10: unrecognized property "name"`, `top/Blueprints:4:16: unrecognized property "visibility"`, `top/Android.bp:5:14: unrecognized property "licenses"`, `top/Android.bp:3:10: unrecognized property "name"`, `top/Android.bp:4:16: unrecognized property "visibility"`, }, }, { name: "multiple packages in separate directories", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { }`), "other/Blueprints": []byte(` "other/Android.bp": []byte(` package { }`), "other/nested/Blueprints": []byte(` "other/nested/Android.bp": []byte(` package { }`), }, Loading @@ -43,7 +43,7 @@ var packageTests = []struct { { name: "package must not be specified more than once per package", fs: map[string][]byte{ "top/Blueprints": []byte(` "top/Android.bp": []byte(` package { default_visibility: ["//visibility:private"], default_applicable_licenses: ["license"], Loading