Implements printing parameters of failed parameterized tests (issue 71).

This commit is contained in:
vladlosev
2010-05-18 21:13:48 +00:00
parent c828e17175
commit 1097b54dcf
7 changed files with 104 additions and 38 deletions

View File

@@ -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");