1

I am looking for a command line tool that will take googletest executables as an argument and then only runs the fastest tests from that executable. Which those are should be defineable by a given time threshold.

At the first run this tool should run all tests and on further runs it could use the runtimes from the first runs to determine which tests are too slow to be run.

The Visual Studio GoogleTest adapter has such a feature, but I need it as a command line tool, so I can implement a "runFastTests" CMake target that can be used in a fast test-driven development loop.

Thank you for your time.

Knitschi
  • 2,822
  • 3
  • 32
  • 51
  • 1
    I doubt there is such feature - but probably you can implement it by yourself. One of the main good practices regarding unit testing is to have all tests running extremely fast - so need for this feature is rather low... – PiotrNycz Jul 10 '17 at 06:57
  • not all of my tests are unit tests. Some do end to end testing and those are the slow ones. I was thinking about implementing a little program that does what I want, but before I invest time into it, I want to make sure that there is no solution already available. – Knitschi Jul 10 '17 at 14:59
  • We divide our tests by a prefix in the test name like `UnitTest_` so they can be selected for testing with the `--gtest_filter=` flag. I do not know, if this could be a solution for you. – Tobias Wollgam Jul 28 '17 at 13:45
  • @TobiasWollgam Sounds like a good idea that is at least a stop gap solution that can be implemented with a small investment of time. I currently have two test executables, one with the slow tests and one with the faster tests. But I want to get rid of that because it brings unnecessary complexity to the project setup. I think doing it by a test name convention is tidier than that, and will take way less time then implementing a test runner that does the separation automatically. – Knitschi Jul 31 '17 at 08:32

0 Answers0