diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-05-18 21:13:48 +0000 |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-05-18 21:13:48 +0000 |
commit | 3a6fc976eaf7f79a3e8212595ccf49d72d37335b (patch) | |
tree | f05da91adcf46a58df848555809eb74929096bab /test/gtest_output_test_.cc | |
parent | 3232e6797752028fabe8daddd212e52f0ea76ee6 (diff) | |
download | googletest-3a6fc976eaf7f79a3e8212595ccf49d72d37335b.tar.gz |
Implements printing parameters of failed parameterized tests (issue 71).
git-svn-id: http://googletest.googlecode.com/svn/trunk@435 861a406c-534a-0410-8894-cb66d6ee9925
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"); |