Are there any automated unit test schemes for testing the internal flow infrastructure?

We have created a common thread structure to control how we want to use threads in our applications. Are there any frameworks like gtest or cppunit that focus solely on unit testing threads, thread pools, thread queues, etc.?

Right now I'm just looking at a few steps that, as I know, should cover and perform code checks to make sure certain conditions are met (for example, the values ​​are not damaged. B / ca shared resource two or more threads were simultaneously available at the same time) . If I can’t create a final check, then I go to the debugger, but this is similar to testing in the 1990s.

I would like to more systematically test the functionality of the streaming structure for its internal functions, which may not be the same as for all stream frameworks, but I also want to test the general functionality that all stream structures should have (for example, not corrupting data , as well as calculations that they should be, etc.).

Any suggestions are welcome.

+6
c ++ multithreading unit-testing frameworks
source share
2 answers

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

But you need dynamic validation with unit tests. I do not know of any existing structure for this purpose. You could collapse using one of the many unit test frameworks, but it would be difficult to make it reliable. Intel has a set of parallel development tools that might be of interest, but I never used them. They say they can help with unit tests from Visual Studio.

+1
source share

If you are writing a thread library, you must debug it yourself. Threading libraries are not as universal as general purpose programs = D, so you won’t find a specific unit testing framework for your specific problem: D

After this disclaimer. If you worked on Solaris / OSX or FreeBSD ... dtrace would be trivial for the unit test of your library.

+1
source share

All Articles