Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any automated unit testing frameworks for testing an in-house threading framework?

We have created a common threading framework to manage how we want to use threads in our applications. Are there any frameworks out there like gtest or cppunit that solely focus on unit testing threads, thread pools, thread queues, and such?

Right now I just kind of manually go through some steps that I know I should cover and do checks in the code to make sure that certain conditions are met (like values aren't corrupted b/c a shared resource was accessed simultaneously by two or more threads at once) If I'm not able to create definitive check, then I step through the debugger but this seems like it's testing in the 1990's.

I would like to more systematically test the functionality of the threading framework for it's internal functionality that might not be the same as all threading frameworks, but I also want to test common functionality that all threading frameworks should have (like not deadlocking, not corrupting data a.k.a counts are what they should be, etc ...).

Any suggestions would be greatly appreciated.

like image 981
Brian T Hannan Avatar asked Jan 13 '10 20:01

Brian T Hannan


1 Answers

If your threads are built on OpenMP, you can use VivaMP for static checking.

But you want dynamic checking with unit tests. I'm not aware of any existing framework for this purpose. You could roll your own with one of the many unit test frameworks out there, but it would be hard to make it robust. Intel has a suite of parallel development tools that might be of interest, but I've never used them. They say that they can help with unit tests from within Visual Studio.

like image 182
metal Avatar answered Oct 25 '22 09:10

metal