aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-04-19 21:37:06 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-04-20 11:17:09 +0000
commit44daf782269f039367adef7828494af047a198be (patch)
tree8fbe8680783d5efa82097b72e93ef291fd9ec59e /src/test/shell/bazel
parent7ff6825b7a5456a2f31273b3b7749e1eec242feb (diff)
Overwrite the WORKSPACE file for new_local_repository
This prevents an ugly warning when you do something like: new_local_repository( name = "bazel_tools", path = ".", build_file = "BUILD", ) -- MOS_MIGRATED_REVID=120271366
Diffstat (limited to 'src/test/shell/bazel')
-rwxr-xr-xsrc/test/shell/bazel/local_repository_test.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/shell/bazel/local_repository_test.sh b/src/test/shell/bazel/local_repository_test.sh
index 70f9be6769..d078cadba3 100755
--- a/src/test/shell/bazel/local_repository_test.sh
+++ b/src/test/shell/bazel/local_repository_test.sh
@@ -504,6 +504,26 @@ EOF
expect_log "//external:my_repo"
}
+function test_override_workspace_file() {
+ local bar=$TEST_TMPDIR/bar
+ mkdir -p "$bar"
+ cat > "$bar/WORKSPACE" <<EOF
+workspace(name = "foo")
+EOF
+
+ cat > WORKSPACE <<EOF
+new_local_repository(
+ name = "bar",
+ path = "$bar",
+ build_file = "BUILD",
+)
+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."
+}
+
+
function test_overlaid_build_file() {
local mutant=$TEST_TMPDIR/mutant
mkdir $mutant