Hi,Is it possible to author tests and test fixtures such that the tests are run multiple times using different test fixtures, without duplicating the test code?
For example, in the Google Testing Framework 'Queue' sample (https://code.google.com/p/googletest/source/browse/trunk/samples/sample3_unittest.cc), I might create a new test fixture (say 'QueueTest2') whose 'SetUp()' method differs very slightly from 'QueueTest'. I'd then like to run exactly the same tests (i.e. 'DefaultConstructor', 'Dequeue', and 'Map') twice, once using 'QueueTest2' and once using 'QueueTest', without duplicating code.If this isn't possible, what is the best way to author tests like this to minimize code duplication?Thanks,Austin
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
Hello!What if I need to run some tests using different fixtures, but all fixtures contain object of the same type with only different values?
Thanks,Dmitriy
четверг, 25 сентября 2014 г., 17:00:26 UTC+3 пользователь Samuel Benzaquen написал:
On Wed, Sep 24, 2014 at 7:27 PM, Austin Kinross <auki...@microsoft.com> wrote:Hi,Is it possible to author tests and test fixtures such that the tests are run multiple times using different test fixtures, without duplicating the test code?You can't change the fixture itself, but you can change a template parameter passed to the fixture by using Typed tests.
For example, in the Google Testing Framework 'Queue' sample (https://code.google.com/p/googletest/source/browse/trunk/samples/sample3_unittest.cc), I might create a new test fixture (say 'QueueTest2') whose 'SetUp()' method differs very slightly from 'QueueTest'. I'd then like to run exactly the same tests (i.e. 'DefaultConstructor', 'Dequeue', and 'Map') twice, once using 'QueueTest2' and once using 'QueueTest', without duplicating code.If this isn't possible, what is the best way to author tests like this to minimize code duplication?Thanks,Austin
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.