summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/manifest_parser_test.cc10
-rw-r--r--src/state.cc1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/manifest_parser_test.cc b/src/manifest_parser_test.cc
index 6909ea9..a8f2e53 100644
--- a/src/manifest_parser_test.cc
+++ b/src/manifest_parser_test.cc
@@ -891,6 +891,16 @@ TEST_F(ParserTest, DefaultDefault) {
EXPECT_EQ("", err);
}
+TEST_F(ParserTest, DefaultDefaultCycle) {
+ ASSERT_NO_FATAL_FAILURE(AssertParse(
+"rule cat\n command = cat $in > $out\n"
+"build a: cat a\n"));
+
+ string err;
+ EXPECT_EQ(0u, state.DefaultNodes(&err).size());
+ EXPECT_EQ("could not determine root nodes of build graph", err);
+}
+
TEST_F(ParserTest, DefaultStatements) {
ASSERT_NO_FATAL_FAILURE(AssertParse(
"rule cat\n command = cat $in > $out\n"
diff --git a/src/state.cc b/src/state.cc
index 6e3e10d..1ceda45 100644
--- a/src/state.cc
+++ b/src/state.cc
@@ -187,7 +187,6 @@ vector<Node*> State::RootNodes(string* err) {
if (!edges_.empty() && root_nodes.empty())
*err = "could not determine root nodes of build graph";
- assert(edges_.empty() || !root_nodes.empty());
return root_nodes;
}