Expand equality failure messages with a by-line diff.

This commit is contained in:
kosak
2014-07-28 21:54:50 +00:00
parent bd263344f9
commit b54098a9ab
5 changed files with 433 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ Expected: true
gtest_output_test_.cc:#: Failure
Value of: 3
Expected: 2
[==========] Running 63 tests from 28 test cases.
[==========] Running 64 tests from 28 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
@@ -31,7 +31,7 @@ BarEnvironment::SetUp() called.
[ OK ] PassingTest.PassingTest1
[ RUN ] PassingTest.PassingTest2
[ OK ] PassingTest.PassingTest2
[----------] 1 test from NonfatalFailureTest
[----------] 2 tests from NonfatalFailureTest
[ RUN ] NonfatalFailureTest.EscapesStringOperands
gtest_output_test_.cc:#: Failure
Value of: actual
@@ -44,6 +44,17 @@ Value of: actual
Expected: golden
Which is: "\"Line"
[ FAILED ] NonfatalFailureTest.EscapesStringOperands
[ RUN ] NonfatalFailureTest.DiffForLongStrings
gtest_output_test_.cc:#: Failure
Value of: "Line 2"
Expected: golden_str
Which is: "\"Line\0 1\"\nLine 2"
With diff:
@@ -1,2 @@
-\"Line\0 1\"
Line 2
[ FAILED ] NonfatalFailureTest.DiffForLongStrings
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
@@ -599,10 +610,11 @@ FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
Failed
Expected fatal failure.
[==========] 63 tests from 28 test cases ran.
[==========] 64 tests from 28 test cases ran.
[ PASSED ] 21 tests.
[ FAILED ] 42 tests, listed below:
[ FAILED ] 43 tests, listed below:
[ FAILED ] NonfatalFailureTest.EscapesStringOperands
[ FAILED ] NonfatalFailureTest.DiffForLongStrings
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
@@ -645,7 +657,7 @@ Expected fatal failure.
[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
42 FAILED TESTS
43 FAILED TESTS
 YOU HAVE 1 DISABLED TEST
Note: Google Test filter = FatalFailureTest.*:LoggingTest.*