Running specific unit tests


#1

Sometimes it’s useful to run a particular unit test, or group thereof - especially failed ones that you’re expecting to be fixed, and don’t want to wait for everything else to run. With googletest, you can filter which tests you want to run via the --gtest_filter command line parameter.

I’ve been juggling various ways of doing this but it feels very fundamental, so here goes:

What if the UnitTest class provided a category system so you can run specific groups of tests easily?

And perhaps more simply, what if the UnitTestRunner could run individual tests by name (UnitTest has the method getName())?


#2

Yeah that’s a good idea, we’re adding a whole bunch more unit tests at the moment so it’d be good to get in. I’ll take a look at it.


#3

This is on develop now - 6bfcd82.


#4

Now that’s service! Thanks!