aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/local_repository_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/shell/bazel/local_repository_test.sh')
-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"