aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-06-30 14:26:11 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-07-01 07:08:28 +0000
commitdd7bd50ad1f6cdddea218c704c933239e31ce7bf (patch)
tree9b410f58d334cf57d8a00270c17df4178dcc6870 /src/test/shell
parent6b6ff76945c80fb8b11b71d402b5146c85b86859 (diff)
Make repository name warning less noisy
This way it won't print if the repo maintainer doesn't set the repo name. -- MOS_MIGRATED_REVID=126300205
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/local_repository_test.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/shell/bazel/local_repository_test.sh b/src/test/shell/bazel/local_repository_test.sh
index d078cadba3..41b5319f6b 100755
--- a/src/test/shell/bazel/local_repository_test.sh
+++ b/src/test/shell/bazel/local_repository_test.sh
@@ -504,6 +504,28 @@ EOF
expect_log "//external:my_repo"
}
+function test_warning() {
+ local bar=$TEST_TMPDIR/bar
+ rm -rf "$bar"
+ mkdir -p "$bar"
+ touch "$bar/WORKSPACE" "$bar/BUILD"
+ cat > WORKSPACE <<EOF
+local_repository(
+ name = "bar",
+ path = "$bar",
+)
+EOF
+ touch BUILD
+ bazel build @bar//... &> $TEST_log || fail "Build failed"
+ expect_not_log "Workspace name in .* does not match the name given in the repository's definition (@bar); this will cause a build error in future versions."
+
+ cat > "$bar/WORKSPACE" <<EOF
+workspace(name = "foo")
+EOF
+ bazel build @bar//... &> $TEST_log || fail "Build failed"
+ expect_log "Workspace name in .* does not match the name given in the repository's definition (@bar); this will cause a build error in future versions."
+}
+
function test_override_workspace_file() {
local bar=$TEST_TMPDIR/bar
mkdir -p "$bar"