summaryrefslogtreecommitdiffstats
path: root/src/parsers_test.cc
diff options
context:
space:
mode:
authorunknown <petr@meloun.(none)>2012-02-09 21:23:35 (GMT)
committerunknown <petr@meloun.(none)>2012-02-09 21:23:35 (GMT)
commitaf070e520806987bd3b175bf222774de923b62dd (patch)
tree0eff2859034dd46b6cbd8bd93fed41b8824e642e /src/parsers_test.cc
parent7504ab4e5dbb153979333c67a8a43448040b718d (diff)
downloadNinja-af070e520806987bd3b175bf222774de923b62dd.zip
Ninja-af070e520806987bd3b175bf222774de923b62dd.tar.gz
Ninja-af070e520806987bd3b175bf222774de923b62dd.tar.bz2
Response files
Diffstat (limited to 'src/parsers_test.cc')
-rw-r--r--src/parsers_test.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/parsers_test.cc b/src/parsers_test.cc
index 2a30a83..ff04608 100644
--- a/src/parsers_test.cc
+++ b/src/parsers_test.cc
@@ -97,6 +97,24 @@ TEST_F(ParserTest, IgnoreIndentedBlankLines) {
EXPECT_EQ("1", state.bindings_.LookupVariable("variable"));
}
+TEST_F(ParserTest, ResponseFiles) {
+ ASSERT_NO_FATAL_FAILURE(AssertParse(
+"rule cat_rsp\n"
+" command = cat $rspfile > $out\n"
+" rspfile = $rspfile\n"
+" rspfile_content = $in\n"
+"\n"
+"build out: cat_rsp in\n"
+" rspfile=out.rsp\n"));
+
+ ASSERT_EQ(2u, state.rules_.size());
+ const Rule* rule = state.rules_.begin()->second;
+ EXPECT_EQ("cat_rsp", rule->name());
+ EXPECT_EQ("[cat ][$rspfile][ > ][$out]", rule->command().Serialize());
+ EXPECT_EQ("[$rspfile]", rule->rspfile_.Serialize());
+ EXPECT_EQ("[$in]", rule->rspfile_content_.Serialize());
+}
+
TEST_F(ParserTest, Variables) {
ASSERT_NO_FATAL_FAILURE(AssertParse(
"l = one-letter-test\n"