Can googletest unit tests be grouped by categories? For example “SlowRunning”, “BugRegression”, etc. The closest thing I have found is the –gtest_filter option. By appending/prepending category names to the test or fixture names I can simulate the existence of groups. This does not allow me to create groups that are not normally run.
If categories do not exist in googletest, is there a good or best practice workaround?
Edit: Another way is to use the –gtest_also_run_disabled_tests. Adding DISABLED_ in front of tests gives you exactly one conditional category, but I feel like I’m misusing DISABLED when I do it.
One of way use gtest_filter option and use naming convention for tests (as you describe in question).
Other way use separate binaries/executable for any type of test. This way have some limitations because gtest use static autoregistration so if you include some source file – all tests implemented in this source file would be included to generated binary/executable.
By my opinion first method better. Additionally, i would implemented new test registration macro for make my life easier: