summaryrefslogtreecommitdiffstats
path: root/parsers_test.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2010-10-30 19:49:23 (GMT)
committerEvan Martin <martine@danga.com>2010-10-30 19:49:23 (GMT)
commit6dac2ee16cc5b83ee11c70e358f706e2c328b164 (patch)
tree769161d77fd10a7bb2a942feb3b382511a66ae86 /parsers_test.cc
parent900bf30f673db46c6d3c3e5f37c08ce89f3ca73c (diff)
downloadNinja-6dac2ee16cc5b83ee11c70e358f706e2c328b164.zip
Ninja-6dac2ee16cc5b83ee11c70e358f706e2c328b164.tar.gz
Ninja-6dac2ee16cc5b83ee11c70e358f706e2c328b164.tar.bz2
failing test for loading subninja
Diffstat (limited to 'parsers_test.cc')
-rw-r--r--parsers_test.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/parsers_test.cc b/parsers_test.cc
index fa1e74a..f58bcde 100644
--- a/parsers_test.cc
+++ b/parsers_test.cc
@@ -22,11 +22,14 @@ struct ParserTest : public testing::Test,
return false;
}
virtual string ReadFile(const string& path, string* err) {
- assert(false);
- return "";
+ map<string, string>::iterator i = files_.find(path);
+ if (i == files_.end())
+ return "";
+ return i->second;
}
State state;
+ map<string, string> files_;
};
TEST_F(ParserTest, Empty) {
@@ -182,6 +185,11 @@ TEST_F(ParserTest, BuildDir) {
ASSERT_TRUE(state.LookupNode("out/a.o"));
}
+TEST_F(ParserTest, SubNinja) {
+ ASSERT_NO_FATAL_FAILURE(AssertParse(
+"subninja test.ninja\n"));
+}
+
TEST(MakefileParser, Basic) {
MakefileParser parser;
string err;