aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/local_repository_test.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-01-21 19:55:07 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-01-22 15:53:30 +0000
commit49978055a2ecca23df5fed892fc529e235ae9f07 (patch)
tree4615f3a8c2bd0c073c21d835e5b6f248442f12d8 /src/test/shell/bazel/local_repository_test.sh
parent1a34a248b05c9e64e2db0d76f3ad8e93cf755f99 (diff)
Fix NullPointerException in DelegatingWalkableGraph
Package name comparison did not included the repository name which leads to a crash when trying to build :* targets. Fixes #792. -- MOS_MIGRATED_REVID=112708531
Diffstat (limited to 'src/test/shell/bazel/local_repository_test.sh')
-rwxr-xr-xsrc/test/shell/bazel/local_repository_test.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/shell/bazel/local_repository_test.sh b/src/test/shell/bazel/local_repository_test.sh
index 7e6d8a447c..0719f151cb 100755
--- a/src/test/shell/bazel/local_repository_test.sh
+++ b/src/test/shell/bazel/local_repository_test.sh
@@ -1000,4 +1000,37 @@ EOF
bazel build @r//:a || fail "build failed"
}
+# Regression test for https://github.com/bazelbuild/bazel/issues/792
+function test_build_all() {
+ local r=$TEST_TMPDIR/r
+ mkdir -p $r
+ touch $r/WORKSPACE
+ cat > $r/BUILD <<'EOF'
+genrule(
+ name = "dummy1",
+ outs = ["dummy.txt"],
+ cmd = "echo 1 >$@",
+ visibility = ["//visibility:public"],
+)
+EOF
+
+ cat > WORKSPACE <<EOF
+local_repository(
+ name="r",
+ path="$r",
+)
+EOF
+
+ cat > BUILD <<'EOF'
+genrule(
+ name = "dummy2",
+ srcs = ["@r//:dummy1"],
+ outs = ["dummy.txt"],
+ cmd = "cat $(SRCS) > $@",
+)
+EOF
+
+ bazel build :* || fail "build failed"
+}
+
run_suite "local repository tests"