Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
3a47ddf8
Commit
3a47ddf8
authored
Jul 15, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes gtest report failures to Visual Studio's Output window. Based on code by Alexander Demin.
parent
8bdb31e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
gtest.cc
src/gtest.cc
+14
-4
No files found.
src/gtest.cc
View file @
3a47ddf8
...
...
@@ -2556,10 +2556,19 @@ static internal::String PrintTestPartResultToString(
}
// Prints a TestPartResult.
static
void
PrintTestPartResult
(
const
TestPartResult
&
test_part_result
)
{
printf
(
"%s
\n
"
,
PrintTestPartResultToString
(
test_part_result
).
c_str
());
static
void
PrintTestPartResult
(
const
TestPartResult
&
test_part_result
)
{
const
internal
::
String
&
result
=
PrintTestPartResultToString
(
test_part_result
);
printf
(
"%s
\n
"
,
result
.
c_str
());
fflush
(
stdout
);
#if GTEST_OS_WINDOWS
// If the test program runs in Visual Studio or a debugger, the
// following states add the test part result message to the Output
// window such that the user can double-click on it to jump to the
// corresponding source code location; otherwise they do nothing.
::
OutputDebugStringA
(
result
.
c_str
());
::
OutputDebugStringA
(
"
\n
"
);
#endif
}
// class PrettyUnitTestResultPrinter
...
...
@@ -3426,7 +3435,8 @@ void UnitTest::AddTestPartResult(TestPartResultType result_type,
for
(
int
i
=
0
;
i
<
impl_
->
gtest_trace_stack
()
->
size
();
i
++
)
{
const
internal
::
TraceInfo
&
trace
=
impl_
->
gtest_trace_stack
()
->
GetElement
(
i
);
msg
<<
"
\n
"
<<
trace
.
file
<<
":"
<<
trace
.
line
<<
": "
<<
trace
.
message
;
msg
<<
"
\n
"
<<
internal
::
FormatFileLocation
(
trace
.
file
,
trace
.
line
)
<<
" "
<<
trace
.
message
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment