@@ -149,6 +149,45 @@ TEST_F(GraphTest, ImplicitOutputOutOfDate) {
149
149
EXPECT_TRUE (GetNode (" out.imp" )->dirty ());
150
150
}
151
151
152
+ TEST_F (GraphTest, ImplicitOutputOnlyParse) {
153
+ ASSERT_NO_FATAL_FAILURE (AssertParse (&state_,
154
+ " build | out.imp: cat in\n " ));
155
+
156
+ Edge* edge = GetNode (" out.imp" )->in_edge ();
157
+ EXPECT_EQ (1 , edge->outputs_ .size ());
158
+ EXPECT_EQ (" out.imp" , edge->outputs_ [0 ]->path ());
159
+ EXPECT_EQ (1 , edge->implicit_outs_ );
160
+ EXPECT_EQ (edge, GetNode (" out.imp" )->in_edge ());
161
+ }
162
+
163
+ TEST_F (GraphTest, ImplicitOutputOnlyMissing) {
164
+ ASSERT_NO_FATAL_FAILURE (AssertParse (&state_,
165
+ " build | out.imp: cat in\n " ));
166
+ fs_.Create (" in" , " " );
167
+
168
+ Edge* edge = GetNode (" out.imp" )->in_edge ();
169
+ string err;
170
+ EXPECT_TRUE (scan_.RecomputeDirty (edge, &err));
171
+ ASSERT_EQ (" " , err);
172
+
173
+ EXPECT_TRUE (GetNode (" out.imp" )->dirty ());
174
+ }
175
+
176
+ TEST_F (GraphTest, ImplicitOutputOnlyOutOfDate) {
177
+ ASSERT_NO_FATAL_FAILURE (AssertParse (&state_,
178
+ " build | out.imp: cat in\n " ));
179
+ fs_.Create (" out.imp" , " " );
180
+ fs_.Tick ();
181
+ fs_.Create (" in" , " " );
182
+
183
+ Edge* edge = GetNode (" out.imp" )->in_edge ();
184
+ string err;
185
+ EXPECT_TRUE (scan_.RecomputeDirty (edge, &err));
186
+ ASSERT_EQ (" " , err);
187
+
188
+ EXPECT_TRUE (GetNode (" out.imp" )->dirty ());
189
+ }
190
+
152
191
TEST_F (GraphTest, PathWithCurrentDirectory) {
153
192
ASSERT_NO_FATAL_FAILURE (AssertParse (&state_,
154
193
" rule catdep\n "
0 commit comments