GoogleTest integration with CTest

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

GoogleTest integration with CTest

Chad Gilbert
​Hi all,

I'm a new poster on this list. It's nice to meet you.

I
​ was very excited when I came across the new support for GoogleTest test discovery in CMake (https://blog.kitware.com/dynamic-google-test-discovery-in-cmake-3-10/). However, this new approach and the older one both play very poorly with any of my tests that require fixtures.

The situation I have is this: I have about a hundred tests defined which rely on a socket connection that has to pass a few messages each time it's initialized. I define a static test fixture in GoogleTest to make the connection to start the socket connection and initialize the server, then run all of the tests and clean up once when they're all done.

The problem is that when I use `gtest_discover_tests()` (or `gtest_add_tests()`), CTest breaks all of the tests apart into separate processes, adding a couple seconds overhead to each test (the tests themselves take on average a millisecond to run). Perhaps that's still acceptable for now where I've only got ~100 tests that depend on that fixture, but I worry my list of tests will still grow, and it smells like that penalty should be avoidable somehow.

I don't necessarily need to be able to see the output of every CTest (though that's a nice-to-have). What I really need is to be able to see all of the test results in my project CDash. Is there any way to have GoogleTest supply its own test results to CDash such that the GTest executable is only run once, but all of the individual test results can be reported?

Thanks!

Chad

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake