开发者

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

开发者 https://www.devze.com 2022-12-16 20:30 出处:网络
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 thread

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 t开发者_如何转开发o 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.


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.


If you write a threading library you have to debug it yourself. Threading libraries aren't as general purpose as general purpose programs =D so you won't find a specific unit testing framework for your specific problem :D

After that disclaimer though. If you were running on Solaris / OSX or FreeBSD.... dtrace would make it trivial to unit test your library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号