Merge "Add some more visibility test cases."

am: d14e5c6ed4

Change-Id: I6a004dccc44c40ff14096cde952b07874fbe3e88
This commit is contained in:
Martin Stjernholm
2019-05-23 10:16:22 -07:00
committed by android-build-merger

View File

@@ -1,10 +1,11 @@
package android package android
import ( import (
"github.com/google/blueprint"
"io/ioutil" "io/ioutil"
"os" "os"
"testing" "testing"
"github.com/google/blueprint"
) )
var visibilityTests = []struct { var visibilityTests = []struct {
@@ -198,10 +199,17 @@ var visibilityTests = []struct {
name: "libnested", name: "libnested",
deps: ["libexample"], deps: ["libexample"],
}`), }`),
"other/Blueprints": []byte(`
mock_library {
name: "libother",
deps: ["libexample"],
}`),
}, },
expectedErrors: []string{ expectedErrors: []string{
`module "libnested" variant "android_common": depends on //top:libexample which is not` + `module "libnested" variant "android_common": depends on //top:libexample which is not` +
` visible to this module; //top:libexample is only visible to \[//top:__pkg__\]`, ` visible to this module; //top:libexample is only visible to \[//top:__pkg__\]`,
`module "libother" variant "android_common": depends on //top:libexample which is not` +
` visible to this module; //top:libexample is only visible to \[//top:__pkg__\]`,
}, },
}, },
{ {
@@ -223,10 +231,17 @@ var visibilityTests = []struct {
name: "libnested", name: "libnested",
deps: ["libexample"], deps: ["libexample"],
}`), }`),
"other/Blueprints": []byte(`
mock_library {
name: "libother",
deps: ["libexample"],
}`),
}, },
expectedErrors: []string{ expectedErrors: []string{
`module "libnested" variant "android_common": depends on //top:libexample which is not` + `module "libnested" variant "android_common": depends on //top:libexample which is not` +
` visible to this module; //top:libexample is only visible to \[//top:__pkg__\]`, ` visible to this module; //top:libexample is only visible to \[//top:__pkg__\]`,
`module "libother" variant "android_common": depends on //top:libexample which is not` +
` visible to this module; //top:libexample is only visible to \[//top:__pkg__\]`,
}, },
}, },
{ {