Add cxx extractor test for a wrongly named include
Make sure the extractor doesn't die if the code tries to include a file that doesn't exist on disk.
@@ -352,6 +352,12 @@ TEST_F(CxxExtractorTest, DoesNotBreakForCompilerErrors) {
FillAndVerifyCompilationUnit("b.cc", {}, {"./b.h", "b.cc"});
}
+TEST_F(CxxExtractorTest, DoesNotBreakForMissingIncludes) {
+ AddSourceFile("b.cc", "#include \"D.h\"\nint main() { return 0;}");
+ AddSourceFile("./b.h", "class A;");
+ FillAndVerifyCompilationUnit("b.cc", {}, {"./b.h", "b.cc"});
+}
+
} // anonymous namespace
} // namespace kythe
