Commit 253d2bc5 by shiqian

Makes the output understandable by VS when compiled by MSVC.

parent b7587263
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# here. Please keep the list sorted by first names. # here. Please keep the list sorted by first names.
Ajay Joshi <jaj@google.com> Ajay Joshi <jaj@google.com>
Balázs Dán <balazs.dan@gmail.com>
Bharat Mediratta <bharat@menalto.com> Bharat Mediratta <bharat@menalto.com>
Chandler Carruth <chandlerc@google.com> Chandler Carruth <chandlerc@google.com>
Chris Prince <cprince@google.com> Chris Prince <cprince@google.com>
......
...@@ -2149,7 +2149,11 @@ static const char * TestPartResultTypeToString(TestPartResultType type) { ...@@ -2149,7 +2149,11 @@ static const char * TestPartResultTypeToString(TestPartResultType type) {
case TPRT_NONFATAL_FAILURE: case TPRT_NONFATAL_FAILURE:
case TPRT_FATAL_FAILURE: case TPRT_FATAL_FAILURE:
return "Failure"; #ifdef _MSC_VER
return "error: ";
#else
return "Failure\n";
#endif
} }
return "Unknown result type"; return "Unknown result type";
...@@ -2162,9 +2166,13 @@ static void PrintTestPartResult( ...@@ -2162,9 +2166,13 @@ static void PrintTestPartResult(
printf("%s", file_name == NULL ? "unknown file" : file_name); printf("%s", file_name == NULL ? "unknown file" : file_name);
if (test_part_result.line_number() >= 0) { if (test_part_result.line_number() >= 0) {
#ifdef _MSC_VER
printf("(%d)", test_part_result.line_number());
#else
printf(":%d", test_part_result.line_number()); printf(":%d", test_part_result.line_number());
#endif
} }
printf(": %s\n", TestPartResultTypeToString(test_part_result.type())); printf(": %s", TestPartResultTypeToString(test_part_result.type()));
printf("%s\n", test_part_result.message()); printf("%s\n", test_part_result.message());
fflush(stdout); fflush(stdout);
} }
......
...@@ -78,11 +78,12 @@ def RemoveLocations(output): ...@@ -78,11 +78,12 @@ def RemoveLocations(output):
Returns: Returns:
output with all file location info (in the form of output with all file location info (in the form of
'DIRECTORY/FILE_NAME:LINE_NUMBER: ') replaced by 'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
'FILE_NAME:#: '. 'FILE_NAME:#: '.
""" """
return re.sub(r'.*[/\\](.+)\:\d+\: ', r'\1:#: ', output) return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\: ', r'\1:#: ', output)
def RemoveStackTraces(output): def RemoveStackTraces(output):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment