summaryrefslogtreecommitdiffstats
path: root/src/manifest_parser_test.cc
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2013-07-19 00:51:10 (GMT)
committerNico Weber <thakis@chromium.org>2013-07-19 00:51:10 (GMT)
commita2df2c7d491ca530e16c90d8f9f7012f08c2e0ae (patch)
treebd1134823e4f8c5aec2027c0a34c1ca403b8d235 /src/manifest_parser_test.cc
parent1f357a79984d9cae226ea73269ccabb500be2a31 (diff)
downloadNinja-a2df2c7d491ca530e16c90d8f9f7012f08c2e0ae.zip
Ninja-a2df2c7d491ca530e16c90d8f9f7012f08c2e0ae.tar.gz
Ninja-a2df2c7d491ca530e16c90d8f9f7012f08c2e0ae.tar.bz2
Fix diagnostic formatting regression caused by adaa91a33eb2cf23b88.
Ninja regressed to include a location for every file on the include stack for nested diagnostics, i.e. it would print: input:1: include.ninja:1: expected path Fix this so that it prints only the current file location, like it used to: include.ninja:1: expected path Also add a test for this.
Diffstat (limited to 'src/manifest_parser_test.cc')
-rw-r--r--src/manifest_parser_test.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/manifest_parser_test.cc b/src/manifest_parser_test.cc
index b333549..67c422b 100644
--- a/src/manifest_parser_test.cc
+++ b/src/manifest_parser_test.cc
@@ -762,6 +762,17 @@ TEST_F(ParserTest, Include) {
EXPECT_EQ("inner", state.bindings_.LookupVariable("var"));
}
+TEST_F(ParserTest, BrokenInclude) {
+ files_["include.ninja"] = "build\n";
+ ManifestParser parser(&state, this);
+ string err;
+ EXPECT_FALSE(parser.ParseTest("include include.ninja\n", &err));
+ EXPECT_EQ("include.ninja:1: expected path\n"
+ "build\n"
+ " ^ near here"
+ , err);
+}
+
TEST_F(ParserTest, Implicit) {
ASSERT_NO_FATAL_FAILURE(AssertParse(
"rule cat\n"