aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar Yue Gan <yueg@google.com>2016-05-25 11:48:10 +0000
committerGravatar Yue Gan <yueg@google.com>2016-05-25 11:53:48 +0000
commit36a265772e6e901d4c689634141850814179479c (patch)
tree32b5241ecb5e63caf584c6796713cbee4a0bcd3a /src/test/shell
parent52594355dbeb9496e2775f3c438c1c887ac03f0e (diff)
Better error message when combine //visibility:(public|private) with other forms.
-- MOS_MIGRATED_REVID=123201777
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/bazel_rules_test.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh
index bb3768685b..6b7c04ed1d 100755
--- a/src/test/shell/bazel/bazel_rules_test.sh
+++ b/src/test/shell/bazel/bazel_rules_test.sh
@@ -384,4 +384,20 @@ EOF
bazel build //a:a || fail "build failed"
}
+function test_visibility() {
+ mkdir visibility
+ cat > visibility/BUILD <<EOF
+cc_library(
+ name = "foo",
+ visibility = [
+ "//foo/bar:__pkg__",
+ "//visibility:public",
+ ],
+)
+EOF
+
+ bazel build //visibility:foo &> $TEST_log && fail "Expected failure" || true
+ expect_log "Public or private visibility labels (e.g. //visibility:public or //visibility:private) cannot be used in combination with other labels"
+}
+
run_suite "rules test"