diff options
author | Lukacs Berki <lberki@google.com> | 2015-07-09 07:16:41 +0000 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@google.com> | 2015-07-10 17:17:09 +0000 |
commit | f445ea186018e78ba512ba34e9be9de9d0aa2fda (patch) | |
tree | da8243878d0d0cf9c8e5b0458efce7e8ddb4aa98 /src/test/shell | |
parent | b17c341a42b34d15574e7315d32ea1bb1c27a263 (diff) |
Make include() work with remote repositories.
This in itself is not very interesting because include() is deprecated, but it paves the way for fetching the appropriate dependencies for the eventual label-based load() statements.
--
MOS_MIGRATED_REVID=97849076
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/local_repository_test.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/shell/bazel/local_repository_test.sh b/src/test/shell/bazel/local_repository_test.sh index 8a83a927b3..ccba557d60 100755 --- a/src/test/shell/bazel/local_repository_test.sh +++ b/src/test/shell/bazel/local_repository_test.sh @@ -543,4 +543,33 @@ EOF bazel build @r//:fg || fail "build failed" } +function test_include_from_local_repository() { + local r=$TEST_TMPDIR/r + rm -fr $r + mkdir $r + touch $r/WORKSPACE + mkdir -p $r/b + cat > $r/b/BUILD <<EOF +exports_files(["include"]) +EOF + + cat > $r/b/include <<EOF +filegroup(name = "foo") +EOF + + cat > WORKSPACE <<EOF +local_repository( + name = "r", + path = "$r", +) +EOF + + mkdir -p a + cat > a/BUILD <<EOF +include("@r//b:include") +EOF + + bazel query '//a:foo' || fail "query failed" +} + run_suite "local repository tests" |