I finally figured out how to write Value_Parameterized TESTs. But the
TESTs I want to parameterize are already using a TEST Fixture.
Is there a way to Parameterized TESTs that work with a Fixture? It
doesn't look like its possible, because a TEST can't be a TEST_P...
and a TEST_F... at the same time. Is that correct? Is there a way
around it.
Thank you,
Peter Schwenn
Parameterized tests can use fixtures. In fact, you _have to_ use a
fixture, as explained here:
http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Value_Parameterized_Tests
"To write value-parameterized tests, first you should define a fixture
class. It must be derived from ::testing::TestWithParam<T>, where T is
the type of your parameter values. ..."
>
> Thank you,
>
> Peter Schwenn
>
--
Zhanyong
Thanks for the repsonse.
Am I right in concluding that I would take my current Test Fixture
code, and integrate it with the code that I am using to construct my
new Parameterizing fixture. So that my TESTs, that once had a Test
Fixture and were named TEST_F(...) would now be both Fixtured and
Parameterized (by the same "integrated" fixture code) and would be
named TEST_P(...) ?
On Dec 17, 12:37 am, Zhanyong Wan (λx.x x) <w...@google.com> wrote:
> On Wed, Dec 16, 2009 at 6:11 PM, pschwenn <pschw...@gmail.com> wrote:
> > Googletesters,
>
> > I finally figured out how to write Value_Parameterized TESTs. But the
> > TESTs I want to parameterize are already using a TEST Fixture.
>
> > Is there a way to Parameterized TESTs that work with a Fixture? It
> > doesn't look like its possible, because a TEST can't be a TEST_P...
> > and a TEST_F... at the same time. Is that correct? Is there a way
> > around it.
>
> Parameterized tests can use fixtures. In fact, you _have to_ use a
> fixture, as explained here:
>
> http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Valu...
--
Zhanyong