Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
1097b54d
Commit
1097b54d
authored
May 18, 2010
by
vladlosev
Browse files
Implements printing parameters of failed parameterized tests (issue 71).
parent
c828e171
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
38 deletions
+104
-38
include/gtest/internal/gtest-param-util.h
include/gtest/internal/gtest-param-util.h
+6
-5
src/gtest.cc
src/gtest.cc
+19
-14
test/gtest-param-test_test.cc
test/gtest-param-test_test.cc
+35
-4
test/gtest_output_test.py
test/gtest_output_test.py
+1
-1
test/gtest_output_test_.cc
test/gtest_output_test_.cc
+14
-0
test/gtest_output_test_golden_lin.txt
test/gtest_output_test_golden_lin.txt
+15
-7
test/gtest_output_test_golden_win.txt
test/gtest_output_test_golden_win.txt
+14
-7
No files found.
include/gtest/internal/gtest-param-util.h
View file @
1097b54d
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-linked_ptr.h>
#include <gtest/internal/gtest-linked_ptr.h>
#include <gtest/internal/gtest-port.h>
#include <gtest/internal/gtest-port.h>
#include <gtest/gtest-printers.h>
#if GTEST_HAS_PARAM_TEST
#if GTEST_HAS_PARAM_TEST
...
@@ -171,7 +172,7 @@ class ParamGenerator {
...
@@ -171,7 +172,7 @@ class ParamGenerator {
iterator
end
()
const
{
return
iterator
(
impl_
->
End
());
}
iterator
end
()
const
{
return
iterator
(
impl_
->
End
());
}
private:
private:
::
testing
::
internal
::
linked_ptr
<
const
ParamGeneratorInterface
<
T
>
>
impl_
;
linked_ptr
<
const
ParamGeneratorInterface
<
T
>
>
impl_
;
};
};
// Generates values from a range of two comparable values. Can be used to
// Generates values from a range of two comparable values. Can be used to
...
@@ -285,7 +286,7 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
...
@@ -285,7 +286,7 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
public:
public:
Iterator
(
const
ParamGeneratorInterface
<
T
>*
base
,
Iterator
(
const
ParamGeneratorInterface
<
T
>*
base
,
typename
ContainerType
::
const_iterator
iterator
)
typename
ContainerType
::
const_iterator
iterator
)
:
base_
(
base
),
iterator_
(
iterator
)
{}
:
base_
(
base
),
iterator_
(
iterator
)
{}
virtual
~
Iterator
()
{}
virtual
~
Iterator
()
{}
virtual
const
ParamGeneratorInterface
<
T
>*
BaseGenerator
()
const
{
virtual
const
ParamGeneratorInterface
<
T
>*
BaseGenerator
()
const
{
...
@@ -504,12 +505,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
...
@@ -504,12 +505,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
param_it
!=
generator
.
end
();
++
param_it
,
++
i
)
{
param_it
!=
generator
.
end
();
++
param_it
,
++
i
)
{
Message
test_name_stream
;
Message
test_name_stream
;
test_name_stream
<<
test_info
->
test_base_name
.
c_str
()
<<
"/"
<<
i
;
test_name_stream
<<
test_info
->
test_base_name
.
c_str
()
<<
"/"
<<
i
;
::
testing
::
internal
::
MakeAndRegisterTestInfo
(
std
::
string
comment
=
"GetParam() = "
+
PrintToString
(
*
param_it
);
MakeAndRegisterTestInfo
(
test_case_name_stream
.
GetString
().
c_str
(),
test_case_name_stream
.
GetString
().
c_str
(),
test_name_stream
.
GetString
().
c_str
(),
test_name_stream
.
GetString
().
c_str
(),
""
,
// test_case_comment
""
,
// test_case_comment
""
,
// comment; TODO(vladl@google.com): provide parameter value
comment
.
c_str
(),
// representation.
GetTestCaseTypeId
(),
GetTestCaseTypeId
(),
TestCase
::
SetUpTestCase
,
TestCase
::
SetUpTestCase
,
TestCase
::
TearDownTestCase
,
TestCase
::
TearDownTestCase
,
...
...
src/gtest.cc
View file @
1097b54d
...
@@ -2658,6 +2658,19 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
...
@@ -2658,6 +2658,19 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
va_end
(
args
);
va_end
(
args
);
}
}
void
PrintFullTestCommentIfPresent
(
const
TestInfo
&
test_info
)
{
const
char
*
const
comment
=
test_info
.
comment
();
const
char
*
const
test_case_comment
=
test_info
.
test_case_comment
();
if
(
test_case_comment
[
0
]
!=
'\0'
||
comment
[
0
]
!=
'\0'
)
{
printf
(
", where %s"
,
test_case_comment
);
if
(
test_case_comment
[
0
]
!=
'\0'
&&
comment
[
0
]
!=
'\0'
)
{
printf
(
" and "
);
}
printf
(
"%s"
,
comment
);
}
}
// This class implements the TestEventListener interface.
// This class implements the TestEventListener interface.
//
//
// Class PrettyUnitTestResultPrinter is copyable.
// Class PrettyUnitTestResultPrinter is copyable.
...
@@ -2748,11 +2761,7 @@ void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
...
@@ -2748,11 +2761,7 @@ void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
void
PrettyUnitTestResultPrinter
::
OnTestStart
(
const
TestInfo
&
test_info
)
{
void
PrettyUnitTestResultPrinter
::
OnTestStart
(
const
TestInfo
&
test_info
)
{
ColoredPrintf
(
COLOR_GREEN
,
"[ RUN ] "
);
ColoredPrintf
(
COLOR_GREEN
,
"[ RUN ] "
);
PrintTestName
(
test_case_name_
.
c_str
(),
test_info
.
name
());
PrintTestName
(
test_case_name_
.
c_str
(),
test_info
.
name
());
if
(
test_info
.
comment
()[
0
]
==
'\0'
)
{
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
else
{
printf
(
", where %s
\n
"
,
test_info
.
comment
());
}
fflush
(
stdout
);
fflush
(
stdout
);
}
}
...
@@ -2775,6 +2784,9 @@ void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
...
@@ -2775,6 +2784,9 @@ void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
ColoredPrintf
(
COLOR_RED
,
"[ FAILED ] "
);
ColoredPrintf
(
COLOR_RED
,
"[ FAILED ] "
);
}
}
PrintTestName
(
test_case_name_
.
c_str
(),
test_info
.
name
());
PrintTestName
(
test_case_name_
.
c_str
(),
test_info
.
name
());
if
(
test_info
.
result
()
->
Failed
())
PrintFullTestCommentIfPresent
(
test_info
);
if
(
GTEST_FLAG
(
print_time
))
{
if
(
GTEST_FLAG
(
print_time
))
{
printf
(
" (%s ms)
\n
"
,
internal
::
StreamableToString
(
printf
(
" (%s ms)
\n
"
,
internal
::
StreamableToString
(
test_info
.
result
()
->
elapsed_time
()).
c_str
());
test_info
.
result
()
->
elapsed_time
()).
c_str
());
...
@@ -2823,15 +2835,8 @@ void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
...
@@ -2823,15 +2835,8 @@ void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
}
}
ColoredPrintf
(
COLOR_RED
,
"[ FAILED ] "
);
ColoredPrintf
(
COLOR_RED
,
"[ FAILED ] "
);
printf
(
"%s.%s"
,
test_case
.
name
(),
test_info
.
name
());
printf
(
"%s.%s"
,
test_case
.
name
(),
test_info
.
name
());
if
(
test_case
.
comment
()[
0
]
!=
'\0'
||
PrintFullTestCommentIfPresent
(
test_info
);
test_info
.
comment
()[
0
]
!=
'\0'
)
{
printf
(
"
\n
"
);
printf
(
", where %s"
,
test_case
.
comment
());
if
(
test_case
.
comment
()[
0
]
!=
'\0'
&&
test_info
.
comment
()[
0
]
!=
'\0'
)
{
printf
(
" and "
);
}
}
printf
(
"%s
\n
"
,
test_info
.
comment
());
}
}
}
}
}
}
...
...
test/gtest-param-test_test.cc
View file @
1097b54d
...
@@ -792,19 +792,50 @@ INSTANTIATE_TEST_CASE_P(FourElemSequence, SeparateInstanceTest, Range(1, 4));
...
@@ -792,19 +792,50 @@ INSTANTIATE_TEST_CASE_P(FourElemSequence, SeparateInstanceTest, Range(1, 4));
// sequence element used to instantiate the test.
// sequence element used to instantiate the test.
class
NamingTest
:
public
TestWithParam
<
int
>
{};
class
NamingTest
:
public
TestWithParam
<
int
>
{};
TEST_P
(
NamingTest
,
TestsAreNamedA
ppropriate
ly
)
{
TEST_P
(
NamingTest
,
TestsAreNamedA
ndCommentedCorrect
ly
)
{
const
::
testing
::
TestInfo
*
const
test_info
=
const
::
testing
::
TestInfo
*
const
test_info
=
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
EXPECT_STREQ
(
"ZeroToFiveSequence/NamingTest"
,
test_info
->
test_case_name
());
EXPECT_STREQ
(
"ZeroToFiveSequence/NamingTest"
,
test_info
->
test_case_name
());
Message
msg
;
Message
index_stream
;
msg
<<
"TestsAreNamedAppropriately/"
<<
GetParam
();
index_stream
<<
"TestsAreNamedAndCommentedCorrectly/"
<<
GetParam
();
EXPECT_STREQ
(
msg
.
GetString
().
c_str
(),
test_info
->
name
());
EXPECT_STREQ
(
index_stream
.
GetString
().
c_str
(),
test_info
->
name
());
const
::
std
::
string
comment
=
"GetParam() = "
+
::
testing
::
PrintToString
(
GetParam
());
EXPECT_EQ
(
comment
,
test_info
->
comment
());
}
}
INSTANTIATE_TEST_CASE_P
(
ZeroToFiveSequence
,
NamingTest
,
Range
(
0
,
5
));
INSTANTIATE_TEST_CASE_P
(
ZeroToFiveSequence
,
NamingTest
,
Range
(
0
,
5
));
// Class that cannot be streamed into an ostream. It needs to be copyable
// (and, in case of MSVC, also assignable) in order to be a test parameter
// type. Its default copy constructor and assignment operator do exactly
// what we need.
class
Unstreamable
{
public:
explicit
Unstreamable
(
int
value
)
:
value_
(
value
)
{}
private:
int
value_
;
};
class
CommentTest
:
public
TestWithParam
<
Unstreamable
>
{};
TEST_P
(
CommentTest
,
TestsWithUnstreamableParamsCommentedCorrectly
)
{
const
::
testing
::
TestInfo
*
const
test_info
=
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
const
::
std
::
string
comment
=
"GetParam() = "
+
::
testing
::
PrintToString
(
GetParam
());
EXPECT_EQ
(
comment
,
test_info
->
comment
());
}
INSTANTIATE_TEST_CASE_P
(
InstantiationWithComments
,
CommentTest
,
Values
(
Unstreamable
(
1
)));
#endif // GTEST_HAS_PARAM_TEST
#endif // GTEST_HAS_PARAM_TEST
TEST
(
CompileTest
,
CombineIsDefinedOnlyWhenGtestHasParamTestIsDefined
)
{
TEST
(
CompileTest
,
CombineIsDefinedOnlyWhenGtestHasParamTestIsDefined
)
{
...
...
test/gtest_output_test.py
View file @
1097b54d
...
@@ -240,7 +240,7 @@ SUPPORTS_STACK_TRACES = False
...
@@ -240,7 +240,7 @@ SUPPORTS_STACK_TRACES = False
CAN_GENERATE_GOLDEN_FILE
=
(
SUPPORTS_DEATH_TESTS
and
CAN_GENERATE_GOLDEN_FILE
=
(
SUPPORTS_DEATH_TESTS
and
SUPPORTS_TYPED_TESTS
and
SUPPORTS_TYPED_TESTS
and
SUPPORTS_THREADS
)
(
SUPPORTS_THREADS
or
IS_WINDOWS
)
)
class
GTestOutputTest
(
gtest_test_utils
.
TestCase
):
class
GTestOutputTest
(
gtest_test_utils
.
TestCase
):
...
...
test/gtest_output_test_.cc
View file @
1097b54d
...
@@ -87,6 +87,20 @@ TEST(PassingTest, PassingTest1) {
...
@@ -87,6 +87,20 @@ TEST(PassingTest, PassingTest1) {
TEST
(
PassingTest
,
PassingTest2
)
{
TEST
(
PassingTest
,
PassingTest2
)
{
}
}
// Tests that parameters of failing parameterized tests are printed in the
// failing test summary.
class
FailingParamTest
:
public
testing
::
TestWithParam
<
int
>
{};
TEST_P
(
FailingParamTest
,
Fails
)
{
EXPECT_EQ
(
1
,
GetParam
());
}
// This generates a test which will fail. Google Test is expected to print
// its parameter when it outputs the list of all failed tests.
INSTANTIATE_TEST_CASE_P
(
PrintingFailingParams
,
FailingParamTest
,
testing
::
Values
(
2
));
// Tests catching a fatal failure in a subroutine.
// Tests catching a fatal failure in a subroutine.
TEST
(
FatalFailureTest
,
FatalFailureInSubroutine
)
{
TEST
(
FatalFailureTest
,
FatalFailureInSubroutine
)
{
printf
(
"(expecting a failure that x should be 1)
\n
"
);
printf
(
"(expecting a failure that x should be 1)
\n
"
);
...
...
test/gtest_output_test_golden_lin.txt
View file @
1097b54d
...
@@ -7,7 +7,7 @@ Expected: true
...
@@ -7,7 +7,7 @@ Expected: true
gtest_output_test_.cc:#: Failure
gtest_output_test_.cc:#: Failure
Value of: 3
Value of: 3
Expected: 2
Expected: 2
[0;32m[==========] [mRunning 6
0
tests from 2
5
test cases.
[0;32m[==========] [mRunning 6
1
tests from 2
6
test cases.
[0;32m[----------] [mGlobal test environment set-up.
[0;32m[----------] [mGlobal test environment set-up.
FooEnvironment::SetUp() called.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
...
@@ -411,7 +411,7 @@ Value of: TypeParam()
...
@@ -411,7 +411,7 @@ Value of: TypeParam()
Actual: 0
Actual: 0
Expected: 1
Expected: 1
Expected failure
Expected failure
[0;31m[ FAILED ] [mTypedTest/0.Failure
[0;31m[ FAILED ] [mTypedTest/0.Failure
, where TypeParam = int
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[0;32m[ RUN ] [mUnsigned/TypedTestP/0.Success
[0;32m[ RUN ] [mUnsigned/TypedTestP/0.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/0.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/0.Success
...
@@ -422,7 +422,7 @@ Value of: TypeParam()
...
@@ -422,7 +422,7 @@ Value of: TypeParam()
Expected: 1U
Expected: 1U
Which is: 1
Which is: 1
Expected failure
Expected failure
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure
, where TypeParam = unsigned char
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Success
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/1.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/1.Success
...
@@ -433,7 +433,7 @@ Value of: TypeParam()
...
@@ -433,7 +433,7 @@ Value of: TypeParam()
Expected: 1U
Expected: 1U
Which is: 1
Which is: 1
Expected failure
Expected failure
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure
, where TypeParam = unsigned int
[0;32m[----------] [m4 tests from ExpectFailureTest
[0;32m[----------] [m4 tests from ExpectFailureTest
[0;32m[ RUN ] [mExpectFailureTest.ExpectFatalFailure
[0;32m[ RUN ] [mExpectFailureTest.ExpectFatalFailure
(expecting 1 failure)
(expecting 1 failure)
...
@@ -564,6 +564,13 @@ gtest_output_test_.cc:#: Failure
...
@@ -564,6 +564,13 @@ gtest_output_test_.cc:#: Failure
Failed
Failed
Expected non-fatal failure.
Expected non-fatal failure.
[0;31m[ FAILED ] [mScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[0;31m[ FAILED ] [mScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[0;32m[----------] [m1 test from PrintingFailingParams/FailingParamTest
[0;32m[ RUN ] [mPrintingFailingParams/FailingParamTest.Fails/0
gtest_output_test_.cc:#: Failure
Value of: GetParam()
Actual: 2
Expected: 1
[0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
[0;32m[----------] [mGlobal test environment tear-down
[0;32m[----------] [mGlobal test environment tear-down
BarEnvironment::TearDown() called.
BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
gtest_output_test_.cc:#: Failure
...
@@ -573,9 +580,9 @@ FooEnvironment::TearDown() called.
...
@@ -573,9 +580,9 @@ FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
gtest_output_test_.cc:#: Failure
Failed
Failed
Expected fatal failure.
Expected fatal failure.
[0;32m[==========] [m6
0
tests from 2
5
test cases ran.
[0;32m[==========] [m6
1
tests from 2
6
test cases ran.
[0;32m[ PASSED ] [m21 tests.
[0;32m[ PASSED ] [m21 tests.
[0;31m[ FAILED ] [m
39
tests, listed below:
[0;31m[ FAILED ] [m
40
tests, listed below:
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInNestedSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInNestedSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.NonfatalFailureInSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.NonfatalFailureInSubroutine
...
@@ -615,8 +622,9 @@ Expected fatal failure.
...
@@ -615,8 +622,9 @@ Expected fatal failure.
[0;31m[ FAILED ] [mExpectFailureWithThreadsTest.ExpectFatalFailure
[0;31m[ FAILED ] [mExpectFailureWithThreadsTest.ExpectFatalFailure
[0;31m[ FAILED ] [mExpectFailureWithThreadsTest.ExpectNonFatalFailure
[0;31m[ FAILED ] [mExpectFailureWithThreadsTest.ExpectNonFatalFailure
[0;31m[ FAILED ] [mScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[0;31m[ FAILED ] [mScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
39
FAILED TESTS
40
FAILED TESTS
[0;33m YOU HAVE 1 DISABLED TEST
[0;33m YOU HAVE 1 DISABLED TEST
[mNote: Google Test filter = FatalFailureTest.*:LoggingTest.*
[mNote: Google Test filter = FatalFailureTest.*:LoggingTest.*
...
...
test/gtest_output_test_golden_win.txt
View file @
1097b54d
...
@@ -5,7 +5,7 @@ gtest_output_test_.cc:#: error: Value of: false
...
@@ -5,7 +5,7 @@ gtest_output_test_.cc:#: error: Value of: false
Expected: true
Expected: true
gtest_output_test_.cc:#: error: Value of: 3
gtest_output_test_.cc:#: error: Value of: 3
Expected: 2
Expected: 2
[==========] Running 6
1
tests from 2
7
test cases.
[==========] Running 6
2
tests from 2
8
test cases.
[----------] Global test environment set-up.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
...
@@ -369,7 +369,7 @@ gtest_output_test_.cc:#: error: Value of: TypeParam()
...
@@ -369,7 +369,7 @@ gtest_output_test_.cc:#: error: Value of: TypeParam()
Actual: 0
Actual: 0
Expected: 1
Expected: 1
Expected failure
Expected failure
[ FAILED ] TypedTest/0.Failure
[ FAILED ] TypedTest/0.Failure
, where TypeParam = int
[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[ RUN ] Unsigned/TypedTestP/0.Success
[ RUN ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success
...
@@ -379,7 +379,7 @@ gtest_output_test_.cc:#: error: Value of: TypeParam()
...
@@ -379,7 +379,7 @@ gtest_output_test_.cc:#: error: Value of: TypeParam()
Expected: 1U
Expected: 1U
Which is: 1
Which is: 1
Expected failure
Expected failure
[ FAILED ] Unsigned/TypedTestP/0.Failure
[ FAILED ] Unsigned/TypedTestP/0.Failure
, where TypeParam = unsigned char
[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[ RUN ] Unsigned/TypedTestP/1.Success
[ RUN ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success
...
@@ -389,7 +389,7 @@ gtest_output_test_.cc:#: error: Value of: TypeParam()
...
@@ -389,7 +389,7 @@ gtest_output_test_.cc:#: error: Value of: TypeParam()
Expected: 1U
Expected: 1U
Which is: 1
Which is: 1
Expected failure
Expected failure
[ FAILED ] Unsigned/TypedTestP/1.Failure
[ FAILED ] Unsigned/TypedTestP/1.Failure
, where TypeParam = unsigned int
[----------] 4 tests from ExpectFailureTest
[----------] 4 tests from ExpectFailureTest
[ RUN ] ExpectFailureTest.ExpectFatalFailure
[ RUN ] ExpectFailureTest.ExpectFatalFailure
(expecting 1 failure)
(expecting 1 failure)
...
@@ -479,6 +479,12 @@ Failed
...
@@ -479,6 +479,12 @@ Failed
Expected non-fatal failure.
Expected non-fatal failure.
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
[----------] 1 test from PrintingFailingParams/FailingParamTest
[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
gtest_output_test_.cc:#: error: Value of: GetParam()
Actual: 2
Expected: 1
[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
[----------] Global test environment tear-down
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: error: Failed
gtest_output_test_.cc:#: error: Failed
...
@@ -486,9 +492,9 @@ Expected non-fatal failure.
...
@@ -486,9 +492,9 @@ Expected non-fatal failure.
FooEnvironment::TearDown() called.
FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: error: Failed
gtest_output_test_.cc:#: error: Failed
Expected fatal failure.
Expected fatal failure.
[==========] 6
1
tests from 2
7
test cases ran.
[==========] 6
2
tests from 2
8
test cases ran.
[ PASSED ] 21 tests.
[ PASSED ] 21 tests.
[ FAILED ] 4
0
tests, listed below:
[ FAILED ] 4
1
tests, listed below:
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
...
@@ -529,8 +535,9 @@ Expected fatal failure.
...
@@ -529,8 +535,9 @@ Expected fatal failure.
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
4
0
FAILED TESTS
4
1
FAILED TESTS
YOU HAVE 1 DISABLED TEST
YOU HAVE 1 DISABLED TEST
Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
...
...
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