diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-05-18 21:13:48 (GMT) |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-05-18 21:13:48 (GMT) |
commit | 1097b54dcf1cd393e64ec0adf54301a575bbbc1c (patch) | |
tree | f05da91adcf46a58df848555809eb74929096bab /test/gtest_output_test_.cc | |
parent | c828e171752e67ebba33197ba758a4f24188efcf (diff) | |
download | googletest-1097b54dcf1cd393e64ec0adf54301a575bbbc1c.zip googletest-1097b54dcf1cd393e64ec0adf54301a575bbbc1c.tar.gz googletest-1097b54dcf1cd393e64ec0adf54301a575bbbc1c.tar.bz2 |
Implements printing parameters of failed parameterized tests (issue 71).
Diffstat (limited to 'test/gtest_output_test_.cc')
-rw-r--r-- | test/gtest_output_test_.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc index 32fb49a..1ac439c 100644 --- a/test/gtest_output_test_.cc +++ b/test/gtest_output_test_.cc @@ -87,6 +87,20 @@ TEST(PassingTest, PassingTest1) { 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. TEST(FatalFailureTest, FatalFailureInSubroutine) { printf("(expecting a failure that x should be 1)\n"); |