如何写入“构建问题” Qt Creator 中的选项卡?

发布于 2025-01-05 12:08:55 字数 320 浏览 2 评论 0原文

我正在尝试将 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 技术交流群。

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

发布评论

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

评论(1

我的影子我的梦 2025-01-12 12:08:55

不,构建输出是专门为捕获编译和链接错误而设计的,当您单击此列表中的项目时,Qt Creator 会链接到源代码的相关部分。编译输出是 [n]makemsbuild 构建工具的完整输出。自定义构建步骤仅在此显示,使用插件,您当然可以做各种魔术(我在这里没有经验,但由于 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 or msbuild 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).

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