简体   繁体   English

Eclipse CDT缺少C / C ++单元

[英]Eclipse CDT missing C/C++ Unit

I'm tasked with hooking up Google Test in Eclipse. 我的任务是在Eclipse中连接Google Test。 I got Google Test working from the command-line, but we want it working like JUnit for Java in Eclipse. 我从命令行运行了Google Test,但是我们希望它像Eclipse中的Java的JUnit一样工作。 This is theoretically possible. 从理论上讲这是可能的。 However, running through all the online instructions I can find, they all say to use Run -> Run Configurations... -> C/C++ Unit option. 但是,按照我可以找到的所有在线说明进行操作,他们都说要使用“运行->运行配置...-> C / C ++单元”选项。 For the life of me, I can't find it. 对于我的一生,我找不到它。 Everything else is in the Run Configurations dialog, just not that item. 其他所有内容都在“运行配置”对话框中,而不仅仅是该项目。

在此处输入图片说明

So I figured, even though we have Eclipse for C++ Developers installed (which should contain everything that the CDT Plug-in contains), maybe it's missing the unit testing stuff. 因此,我认为,即使我们已经安装了Eclipse for C ++开发人员(应该包含CDT插件包含的所有内容),也许它还是缺少单元测试的东西。 Trying to update CDT, however, just shows that the only thing missing is the Autotools stuff (which we have no need for). 但是,尝试更新CDT只是表明,缺少的只是Autotools的东西(我们不需要)。

Vital statistics: 重要统计数据:

  • Eclipse version: Oxygen.1a Release (4.7.1a) Eclipse版本:Oxygen.1a版本(4.7.1a)
  • Operating System: Linux, CentOS 操作系统:Linux,CentOS
  • Compiler: gcc 编译器:gcc

I know that's the not the latest version of Oxygen. 我知道那不是氧气的最新版本。 It's the latest we can use, because the current versions have a bug that doesn't recognize our code as valid C++. 这是我们可以使用的最新版本,因为当前版本存在一个错误,无法将我们的代码识别为有效的C ++。

How do I get the C/C++ Unit option in Run Configurations? 如何在“运行配置”中获取C / C ++单元选项?

You need to install "C/C++ unit testing support" feature. 您需要安装“ C / C ++单元测试支持”功能。 Go to Help -> Install new software , select All available sites and search for it. 转到“ Help ->“ Install new software ,选择“ All available sites并进行搜索。 Installing it will require Eclipse restart. 安装它需要重新启动Eclipse。 After restart C++ unit test group will appear in the list of Debug configurations. 重新启动后,C ++单元测试组将出现在“调试”配置列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM