@@ -1231,7 +1231,7 @@ TEST_F(BuildTest, DepFileCanonicalize) {
12311231" build gen/stuff\\ things/foo.o: cc x\\ y/z\\ foo.c\n " ));
12321232
12331233 fs_.Create (" x/y/z/foo.c" , " " );
1234- GetNode (" bar.h" )->MarkDirty (); // Mark bar.h as missing.
1234+ state_. GetNodeDeps (" bar.h" , 0 )->MarkDirty (); // Mark bar.h as missing.
12351235 // Note, different slashes from manifest.
12361236 fs_.Create (" gen/stuff\\ things/foo.o.d" ,
12371237 " gen\\ stuff\\ things\\ foo.o: blah.h bar.h\n " );
@@ -3214,7 +3214,7 @@ TEST_F(BuildWithDepsLogTest, DepFileDepsLogCanonicalize) {
32143214 builder.command_runner_ .reset (&command_runner_);
32153215 SafeRelease protect (&builder);
32163216
3217- state. GetNode ( " bar.h " , 0 )-> MarkDirty (); // Mark bar.h as missing.
3217+ // bar.h as missing.
32183218 EXPECT_TRUE (builder.AddTarget (" a/b/c/d/e/fo o.o" , &err));
32193219 ASSERT_EQ (" " , err);
32203220
@@ -3365,6 +3365,28 @@ TEST_F(BuildTest, DyndepMissingAndNoRule) {
33653365 EXPECT_EQ (" loading 'dd': No such file or directory" , err);
33663366}
33673367
3368+ TEST_F (BuildTest, DyndepMissingInput) {
3369+ // Check that the build system detects when a dyndep-provided input is missing
3370+ ASSERT_NO_FATAL_FAILURE (AssertParse (&state_,
3371+ R"ninja(
3372+ rule touch
3373+ command = touch $out $out.imp
3374+ build out: touch || dd
3375+ dyndep = dd
3376+ )ninja" ));
3377+ fs_.Create (" dd" , R"ninja(
3378+ ninja_dyndep_version = 1
3379+ build out | out.imp: dyndep | tmp.imp missing.imp
3380+ )ninja" );
3381+
3382+ string err;
3383+ EXPECT_TRUE (builder_.AddTarget (" out" , &err));
3384+ ASSERT_EQ (" " , err);
3385+ EXPECT_EQ (builder_.Build (&err), ExitFailure);
3386+ EXPECT_EQ (" 'tmp.imp', needed by dyndep 'dd', missing and no known rule to make it" , err);
3387+ EXPECT_TRUE (command_runner_.commands_ran_ .empty ());
3388+ }
3389+
33683390TEST_F (BuildTest, DyndepReadyImplicitConnection) {
33693391 // Verify that a dyndep file can be loaded immediately to discover
33703392 // that one edge has an implicit output that is also an implicit
0 commit comments