如何写入“构建问题” Qt Creator 中的选项卡?
我正在尝试将 googletest 与我的 Qt Creator 集成。
基本上我有一个 googletest-listener,它评估我的单元测试并将结果打印到标准输出。现在我正在尝试使该侦听器成为构建步骤,以便它在测试未成功时告诉我。结果现在显示在“编译输出”选项卡中。
我现在想做的是结果也显示在“构建问题”选项卡中。就像正常的构建错误一样。如果不使用 Creator 插件,这是否可能?
编辑: 与此同时,我找到了解决方案:看起来 Qt Creator 从 stderr 而不是 stdout 获取所有“构建问题”。所以我只是将错误写入 stderr,现在它可以工作了。
I´m trying to integrate googletest with my Qt Creator.
Basically I´ve got a googletest-listener, which evaluates my unit tests and prints the results to stdout. Now I´m trying to make that listener a build step, so it tells me when a test didn´t succeed. The results are now shown in the "Compile Output" tab.
What I want to do now is that the results are shown in the "Build Problems" tab as well. Just like normal build errors. Is this somehow possible without using a Creator-plugin?
EDIT:
In the meantime I´ve found the solution: It seems like Qt Creator takes all the "build problems" from stderr instead of stdout. So I just wrote my errors to stderr and now it works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,构建输出是专门为捕获编译和链接错误而设计的,当您单击此列表中的项目时,Qt Creator 会链接到源代码的相关部分。编译输出是
[n]make
或msbuild
构建工具的完整输出。自定义构建步骤仅在此显示,使用插件,您当然可以做各种魔术(我在这里没有经验,但由于 Qt Creator 中的所有内容都是插件,所以应该很有可能)。No, the build output is specifically made to catch compile and link errors, which Qt Creator links to the relevant parts of the source code when you click on the items in this list. Compile output is the full output of things like
[n]make
ormsbuild
build tools. Custom build steps only show here, with a plugin, you could of course do all kinds of magic (I have no experience here, but as everything in Qt Creator is a plugin, it should be very possible).