diff options
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 32fb49a9..1ac439c6 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"); |