Visual Studio 2010:使用“跳转到行/列处的文件”的单元测试结果链接

发布于 2024-09-26 17:00:31 字数 449 浏览 0 评论 0原文

我正在对编译器进行单元测试,并希望提供一个可以单击的单元测试结果,并将 Visual Studio 带到指定的测试输入文件,并将光标放在指定的行/列处。这可能吗?

我已经尝试过 http://blogs.msdn.com/b/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats .aspx

例如:

Main.cs(17,20): warning CS0168: 变量 'foo' 已声明但从未使用

I'm unit testing a compiler and would like to provide a unit test result that can be clicked and will bring visual studio to a specified test input file with the cursor at a specified line/col. Is this possible?

I've tried the format outlined at http://blogs.msdn.com/b/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats.aspx

For example:

Main.cs(17,20): warning CS0168: The variable 'foo' is declared but never used

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

-残月青衣踏尘吟 2024-10-03 17:00:31

AFAIK,Visual Studio 不做专栏。我已经构建了自己的 VS 错误格式化程序,sytex 如下所示:

%file%(%line%): error %specific error%: %error text%

这似乎适用于 VS 2008 和 2010。

您提供的链接包含更多详细信息,您可以使用它们来格式化错误或警告字符串。

AFAIK, Visual studio doesn't do columns. I have built my own VS error formatter and the sytex goes like this:

%file%(%line%): error %specific error%: %error text%

That appears to work fine for VS 2008 and 2010.

The link you provided has more details that you can use to format your error or warning string.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文