aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-09-17 13:09:03 +0000
committerGravatar David Chen <dzc@google.com>2015-09-17 19:35:38 +0000
commitafc93a6645d6c8b5be933b48137ac5d0c6aafd61 (patch)
tree6abe4576b2351bbba046816ddf27a601ff442f00 /src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
parentde27f9e46892f6dd95966185a7cf09e256dfe5ff (diff)
*** Reason for rollback *** Broke tests, I mistakenly assumed it was flakiness. *** Original change description *** Remove support for the deprecated include() statement. This is part of the crusade to eliminate as every dependency in Skylark on the rest of the code so that it can be moved deeper in the dependency graph. RELNOTES: The include() statement in BUILD files is not supported anymore. -- MOS_MIGRATED_REVID=103284257
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java b/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
index 9dc2a15db0..75913b42d5 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.syntax.DictionaryLiteral.DictionaryEntryLiteral;
@@ -61,8 +60,9 @@ public class ParserTest extends EvaluationTestCase {
/** Parses a build code (not Skylark) with PythonProcessing enabled */
private List<Statement> parseFileWithPython(String... input) {
return Parser.parseFile(
- ParserInputSource.create(Joiner.on("\n").join(input), null),
+ buildEnvironment.createLexer(input),
getEventHandler(),
+ Environment.EMPTY_PACKAGE_LOCATOR,
/*parsePython=*/true).statements;
}
@@ -1252,4 +1252,18 @@ public class ParserTest extends EvaluationTestCase {
" else: return a");
assertContainsEvent("syntax error at 'else'");
}
+
+ @Test
+ public void testIncludeFailureSkylark() throws Exception {
+ setFailFast(false);
+ parseFileForSkylark("include('//foo:bar')");
+ assertContainsEvent("function 'include' does not exist");
+ }
+
+ @Test
+ public void testIncludeFailure() throws Exception {
+ setFailFast(false);
+ parseFile("include('nonexistent')\n");
+ assertContainsEvent("Invalid label 'nonexistent'");
+ }
}