From 1c15569abb3fda303a6016f31ad0480c79ba85c1 Mon Sep 17 00:00:00 2001 From: Nathan Harmata Date: Fri, 22 Apr 2016 18:32:11 +0000 Subject: Fix target parsing bug with targets in the empty package (e.g. "blah" was incorrectly not being parsed as "//:blah"). Also add tests for parsing absolute labels in the empty package. The empty package has been a thing in Bazel for a while now. Note that the old error message in this case "couldn't determine target for filename 'blah'" was almost always misleading and unhelpful since we were (almost certainly incorrectly) assuming the user intended for 'blah' to be an input file in the empty package. Now the error message would be "no such target '//:blah'") which is similarly misleading and unhelpful but probably marginally less so. If we desire to improve this, a future cleanup can introduce smarter error messages. -- MOS_MIGRATED_REVID=120566819 --- .../lib/pkgcache/TargetPatternEvaluatorTest.java | 114 ++++++++++++++++----- 1 file changed, 88 insertions(+), 26 deletions(-) (limited to 'src/test') diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java index 68b9f64a35..c99a5822b5 100644 --- a/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java +++ b/src/test/java/com/google/devtools/build/lib/pkgcache/TargetPatternEvaluatorTest.java @@ -53,6 +53,7 @@ public class TargetPatternEvaluatorTest extends AbstractTargetPatternEvaluatorTe private Set