VS2010 的错误列表中不再显示 Boost.Test 错误消息
我正在将 Boost.Test 单元测试框架用于本机 C++ 项目。一切工作正常,但升级到 Visual Studio 2010 后遇到一个问题:在测试作为生成后步骤运行后,有关失败测试的消息不再显示在错误列表中。这是一个遗憾,因为 Boost.Test 与本机 C++ 项目的组合最接近(尽管仍然很远)我习惯于单元测试托管项目的舒适度。我正在使用 Boost.Test 作者推荐的配置 此处。任何人都可以帮助解决这个小但有点降低舒适度的问题吗?
问候,
保罗
I am using Boost.Test Unit Test Framework for native C++ projects. All is working fine, but I've got one issue after upgrading to Visual Studio 2010: The messages about failed tests are no more shown in the error list after the tests ran as a post build step. This is a pity since the combination of Boost.Test with native C++ project came closest (although still beeing far away) to the comfort I am used to from unit testing managed projects. I am using the configuration recommended by the authors of Boost.Test here. Can anyone help with this minor but a bit comfort lessening issue?
Regards,
Paul
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不想等待发布并希望自己修复格式化程序,
请打开
BOOST_PATH\boost\test\impl\compiler_log_formatter.ipp
更改(boost_1_46_1 中的第 163 行)
并
再次使用 bjam 重新编译 boost。
If you don't want to wait for a release and want to fix the formatter by yourself
open
BOOST_PATH\boost\test\impl\compiler_log_formatter.ipp
change (line 163 in boost_1_46_1)
to
and recompile boost with bjam again.
Visual Studio 2005 编译器错误的构建输出如下所示:
而 Visual Studio 2010 编译器错误在输出窗口中如下所示:(
编辑:请参阅 gbjbaanb 关于
>1
。)现在,交叉检查 BOOST_ERROR 输出的内容(如果您在构建后步骤中有 exe,则可以使用简单的 printf 来重现):
VS 2005:
VS 2010:
略有差异,但不是太多,并使用手动 printf 进一步测试:
我们还让 VS 2010 将此输出识别为错误:
所以看来您/我们/Boost.Test 需要调整它输出,以便 VS2010 IDE 仍然可以识别错误消息。
Visual Studio 2005 Build output for compiler errors looks like this:
Whereas Visual Studio 2010 compiler errors look like this in the output window:
(Edit: See the comment by gbjbaanb about the
>1
.)Now, crosschecking what BOOST_ERROR outputs (you can use a simple printf to reproduce if you have your exe in the post build step):
VS 2005:
VS 2010:
Slight difference, but not too much and testing further with a manual printf:
We also get VS 2010 to recognize this output as error:
So it would appear you/we/Boost.Test needs to tweak it's output so that the VS2010 IDE still recognizes the error message.