Eclipse CDT中用于C ++的类似JUnit的测试框架 [英] JUnit-like test framework for C++ in Eclipse CDT
问题描述
我正在为Eclipse CDT中的C ++寻找一个测试框架。理想情况下,它应该具有与JUnit提供的功能类似的功能。
I'm looking for a test framework for C++ in Eclipse CDT. Ideally it should have similar functionalities to those offered by JUnit.
我试过CUTE。这是好的,但我似乎不能在我目前工作的项目中创建单元测试。我也不能创建一个单独的单元测试项目来测试我当前的项目,因为我当前的项目是一个C + + hello world应用程序,但CUTE只允许测试项目的C ++库。
I tried CUTE. It is good but I cannot seem to create unit tests within the project I'm currently working on. Neither can I create a separate unit test project to test my current project, because my current project is a C++ hello world application, but CUTE only allows testing project for a C++ library.
任何其他测试框架的想法我可以信赖,有任何教程吗?感谢。
Any idea of other test frameworks I may count on, and is there any tutorial available? Thanks.
推荐答案
使用CUTE描述的问题是,您需要找到一种方法来分割应用程序,您要测试库的功能。
The problem you describe with CUTE is that you need to find a way to split up your application so you move the functionality you want to test to a library. Every test framework will put this requirement on your project structure.
尝试GoogleTest或Boost.Test。
Try GoogleTest or Boost.Test.
GoogleTest没有Eclipse的插件。
GoogleTest does not have a plugin for Eclipse.
请参阅此问题: http://code.google.com/p/googletest/issues/detail?id=40
Cppunit是放弃软件,因为它不再被积极地维护。
Cppunit is abandonware in the sense that it is not actively being maintained anymore.
这篇关于Eclipse CDT中用于C ++的类似JUnit的测试框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!