aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Brian Silverman <bsilver16384@gmail.com>2016-02-01 16:10:27 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-02-02 14:57:01 +0000
commit8f92209acb199ddd4337d9308a37333ce63323d3 (patch)
tree855153e760d2c33e957daa2f8b22f0edb541063a /src/test/java/com/google/devtools
parent975fa32cd130f9f8132ba0d6758b9986b2e99a4a (diff)
Fix "put the colon here" message for non-default repositories.
-- Change-Id: I86b90ff6eda6a16c2efeb8fffca301e2594c254e Reviewed-on: https://bazel-review.googlesource.com/#/c/2784/ MOS_MIGRATED_REVID=113529297
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java
index ae3de80459..98cfe8dea5 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java
@@ -246,6 +246,21 @@ public class SkylarkRuleContextTest extends SkylarkTestCase {
+ "'//test/sub:my_sub_lib.h'?)");
}
+ /* The error message for this case used to be wrong. */
+ @Test
+ public void testPackageBoundaryError_ExternalRepository() throws Exception {
+ scratch.file("/r/BUILD", "cc_library(name = 'cclib',", " srcs = ['sub/my_sub_lib.h'])");
+ scratch.file("/r/sub/BUILD", "cc_library(name = 'my_sub_lib', srcs = ['my_sub_lib.h'])");
+ scratch.overwriteFile("WORKSPACE", "local_repository(name='r', path='/r')");
+ invalidatePackages();
+ reporter.removeHandler(failFastHandler);
+ getConfiguredTarget("@r//:cclib");
+ assertContainsEvent(
+ "/external/r/BUILD:2:10: Label '@r//:sub/my_sub_lib.h' crosses boundary of "
+ + "subpackage '@r//sub' (perhaps you meant to put the colon here: "
+ + "'@r//sub:my_sub_lib.h'?)");
+ }
+
/*
* Making the location in BUILD file the default for "crosses boundary of subpackage" errors does
* not work in this case since the error actually happens in the bzl file. However, because of