如何在 Parasoft 中创建构建数据文件 (bdf)? [英] How to create build data file (bdf) in Parasoft?

查看:33
本文介绍了如何在 Parasoft 中创建构建数据文件 (bdf)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Parasoft C/C++ 测试通过静态测试检查编码标准".我在 Parasoft 用户指南中只找到了如何在 Makefile 项目中创建 bdf"部分.

I am trying to use Parasoft C/C++ Test to check "Coding Standards" with static tests. I found only "How to create bdf in Makefile projects" section in the Parasoft user guide.

如何为每个项目创建一个 bdf?是否必须使用 makefile 项目?

How can I create a bdf for every project? Is it mandatory to use makefile project ?

推荐答案

感谢您的回答,parasoft 不是一个著名的话题.答案值一块金子.我找不到 cpptesttrace.有 cpptest 和 cpptestscan.他们可能吗?我使用旧版本的 parasoft.

Thanks for your answer, parasoft is not a reputed topic. Answers are worth a piece of gold. I couldn't find cpptesttrace. There are cpptest and cpptestscan. Could they be? I use an old version of parasoft.

你说得对.cpptesttrace"是在 Parasoft C++test 9.4 版(2012 年中)中添加的,因此您可能使用的是 9.2 版或更早版本,其中只有cpptestscan".

You are correct. 'cpptesttrace' was added in Parasoft C++test version 9.4 (mid-2012), so likely you are using version 9.2 or earlier, where only 'cpptestscan' was present.

顺便说一句,这里是 C++test 独立安装(不是 Visual Studio 插件)中程序的快速解释:

BTW, here is quick explanation of programs inside C++test standalone installation (not Visual Studio plugin):

  • cpptest - 启动 C++test GUI(基于 Eclipse),通常用于桌面上的交互式工作
  • cpptestcli - 用于自动化静态分析的 C++test 命令行驱动程序,例如作为 Jenkins 工作运行,
  • cpptestscan - 用作编译器命令行的前缀,用于捕获单个编译信息并将其添加到 BDF 文件中
  • cpptesttrace -(自 Parasoft C++test 9.4 起)用作构建命令行的前缀,用于捕获所有编译命令并保存在 BDF 文件中

cpptestscan 和 cpptesttrace 的主要区别在于:

The main difference between cpptestscan and cpptesttrace is that:

  • cpptestscan 必须预先添加到每个编译命令行.这意味着 cpptestscan 只能捕获单个编译,并一次将一个保存到 BDF 中.这通常是通过覆盖 make CC 或 CXX 变量来完成的(指定编译器,例如cpptestscan g++ -c foo.c -o foo.o").
  • cpptestrace 旨在为整个构建命令添加一次,并跟踪构建命令调用的子进程.识别为编译器调用的所有进程的记录都存储在 BDF 中.

如果 makefile 或构建脚本足够灵活以允许在命令行覆盖编译器,cpptestscan 就可以了,例如

cpptestscan was fine if makefile or a build script was flexible enough to allow overwriting compiler at the command line, e.g.

make CXX="cpptestscan g++" CC="cpptestscan gcc"

通常可以使用基于 make 的项目.对于自定义或自动生成的构建脚本,所有赌注都已关闭.通常,唯一的选择是修改项目构建脚本,人们通常对此感到紧张.在这种情况下,cpptesttrace 可以提供帮助,因为它是完全非侵入式的,并且几乎可以从任何构建过程中捕获构建信息.

It is typically possible with make-based projects. As of custom or auto-generated build scripts, all bets are off. Often, the only option was to modify project build scripts, which people are usually nervous about. In such cases cpptesttrace can help, because it is completely non-intrusive, and can capture build information from almost any build process.

回到这篇文章最初的问题,如果你有多个项目:

Going back to the original question of this post, if you have multiple projects:

  • 使用 cpptestscan,您需要在每个项目的构建脚本中以某种方式在编译器前面加上 cpptestscan 以创建相应的 BDF
  • 使用cpptesttrace,你可以为每个项目运行build,在每个项目的build命令前添加cpptesttrace来创建对应的BDF后者通常更容易,但您需要更新的 C++test(最新版本为 10.3).

希望有帮助.顺便说一句:如果您可以升级您的 C++ 测试,请咨询 Parasoft.

I hope that helps. BTW: Check with Parasoft if you could upgrade your C++test.

这篇关于如何在 Parasoft 中创建构建数据文件 (bdf)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆