22 TEST(CLParserTest, ShowIncludes) {
28 "c:\\Some Files\\foobar.h",
""));
31 "c:\\initspaces.h",
""));
35 "Non-default prefix: inc file:"));
38 TEST(CLParserTest, FilterInputFilename) {
45 "src\\cl_helper.cc(166) : fatal error C1075: end " 46 "of file found ..."));
49 TEST(CLParserTest, ParseSimple) {
54 "Note: inc file prefix: foo.h\r\n" 56 "Note: inc file prefix:", &output, &err));
63 TEST(CLParserTest, ParseFilenameFilter) {
73 TEST(CLParserTest, ParseSystemInclude) {
77 "Note: including file: c:\\Program Files\\foo.h\r\n" 78 "Note: including file: d:\\Microsoft Visual Studio\\bar.h\r\n" 79 "Note: including file: path.h\r\n",
88 TEST(CLParserTest, DuplicatedHeader) {
92 "Note: including file: foo.h\r\n" 93 "Note: including file: bar.h\r\n" 94 "Note: including file: foo.h\r\n",
101 TEST(CLParserTest, DuplicatedHeaderPathConverted) {
107 const char kInput[] =
108 "Note: including file: sub/./foo.h\r\n" 109 "Note: including file: bar.h\r\n" 111 "Note: including file: sub\\foo.h\r\n";
113 "Note: including file: sub/foo.h\r\n";
std::set< std::string > includes_
TEST(CLParserTest, ShowIncludes)
static bool FilterInputFilename(std::string line)
Parse a line of cl.exe output and return true if it looks like it's printing an input filename...
Visual Studio's cl.exe requires some massaging to work with Ninja; for example, it emits include info...
bool Parse(const std::string &output, const std::string &deps_prefix, std::string *filtered_output, std::string *err)
Parse the full output of cl, filling filtered_output with the text that should be printed (if any)...
static std::string FilterShowIncludes(const std::string &line, const std::string &deps_prefix)
Parse a line of cl.exe output and extract /showIncludes info.