是否有用于测试内部线程框架的自动化单元测试框架? [英] Are there any automated unit testing frameworks for testing an in-house threading framework?

查看:99
本文介绍了是否有用于测试内部线程框架的自动化单元测试框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们创建了一个通用的线程框架来管理我们如何在我们的应用程序中使用线程。有没有任何框架,像gtest或cppunit,只专注于单元测试线程,线程池,线程队列等?

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?

现在我只是手动地通过一些步骤,我知道我应该覆盖并在代码中做检查,以确保满足某些条件(如值aren 't corrupted b / ca共享资源被两个或多个线程同时访问)如果我不能创建明确的检查,然后我通过调试器,但这似乎是在20世纪90年代的测试。

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 ...).

任何建议都非常感谢。

推荐答案

如果您的线程基于OpenMP构建,您可以使用 VivaMP 进行静态检查。

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

但是你想用单元测试进行动态检查。我不知道任何现有的框架为此目的。你可以使用许多单元测试框架中的一个来实现你自己的,但是很难使其稳定。英特尔有一套可能感兴趣的并行开发工具,但我从来没有使用它们。 他们说,他们可以帮助Visual Studio中的单元测试。

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.

这篇关于是否有用于测试内部线程框架的自动化单元测试框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆