3

Say you have a C++ class B derived of class A. You have extensive tests set up for class A that you would also like to run over instances of class B, as it should fully support A's functionality. Of course you also have additional B specific tests.

How would you setup the tests so that you don't have to duplicate all of A's tests for B?

A specific answer for Google Test would be great.

Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359

1 Answers1

2

Use Typed Tests (if you know in advance which types you want to test) or Type-Parameterized Tests (if you want to decouple fixture creation from test logic).

Oswald
  • 31,254
  • 3
  • 43
  • 68