从 Visual Studio 2010 运行 BOOST 单元测试 [英] Running BOOST unit tests from Visual Studio 2010

查看:17
本文介绍了从 Visual Studio 2010 运行 BOOST 单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 QuantLib 项目.定义了很多 BOOST 单元测试,因此问题是:是否有一种简单的方法可以从 Visual Studio 有选择地运行这些测试(并查看结果)?

I am just starting to work with QuantLib project. There are quite a few BOOST unit tests defined, hence the question: is there an easy way to run these tests selectively from Visual Studio (and see results)?

到目前为止,我只在 .Net 语言中使用过单元测试,如果您使用 MsTest,您可以使用内置的测试运行程序,或者使用其他附加组件(我使用 Resharper 和 TestDriven.NET)构架.在那里你可以选择你运行的测试,你可以用附加的调试器运行它们(不幸的是,有时这很有用).在非托管 C++ 中是否有类似的 BOOST 测试附加组件?

I've only used unit testing in .Net languages so far, and there you can either use the built-in test runner if you use MsTest, or some add-on (I used Resharper and TestDriven.NET) for other frameworks. There you can choose which tests you run, and you can run them with the debugger attached (which is unfortunately useful sometimes). Are there similar add-ons for BOOST tests in unmanaged C++?

推荐答案

是的,你可以!

如果您的 boost 单元测试项目定义正确,那么您可以通过点击从 VS10 调试器运行整个测试项目

If your boost unit test project is defined correctly, then you can run the entire test project from VS10 debugger by clicking

right click on project --> Debug --> Start new instance

这将在 VS 框架内运行测试,这将为您提供所有调试器的好处.

This will run the tests inside VS framework which will give you all the debugger goodies.

要运行特定的测试套件/案例,只需在

For running specific test suites/cases, just edit the project command line arguments under

right click on project --> Properties --> General --> Debugging

并根据其他答案中的链接添加参数

and add the parameters according to the links in the other answers

这篇关于从 Visual Studio 2010 运行 BOOST 单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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