• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++test关于resource参数和include/exclude参数说明

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
C++test工具:Parasoft® C/C++test® 是专业针对C和C++语言的开发测试方案,经广泛证明能提高软件开发效率和代码质量的自动化最佳实践解决方案。
 
如果需要使用C++test的命令行进行自动化测试分析,需要用到cpptestcli命令,并且通常如果需要设置过滤扫描时,可以考虑使用下面的三个关键参数选项:
 
 
-resource %RESOURCE%
    Specifies a workspace resource path %RESOURCE% to add to the test scope.
    Use multiple times to specify multiple resources. Use quotes when the
    resource path contains spaces or other non-alphanumeric characters.
    If %RESOURCE% is a ".properties" file, the value corresponding to the
    key "com.parasoft.eclipse.checker.core.resources" will be interpreted
    as a colon(:)-separated list of resources. Only one properties file can
    be thus specified. If no resources are specified on the command-line,
    the whole workspace will be tested.
    Examples:
      -resource "MyProject"
      -resource "/MyProject/src"
      -resource "/MyProject/src/MyClass.cpp"
      -resource testedprojects.properties -include %PATTERN%
-exclude %PATTERN%
    Specifies files to be included/excluded during testing.
    Patterns specify file names or paths, with the wildcards * and ? accepted
    and the special wildcard ** used to specify one or more path name segments.
    Examples:
      -include **/Bank.cpp (test Bank.cpp files)
      -include **/ATM/Bank/*.cpp (test all .cpp files in folder ATM/Bank)
      -include c:/ATM/Bank/Bank.cpp (test only the c:/ATM/Bank/Bank.cpp file)
      -exclude **/internal/** (test everything except files in folder "internal")
      -exclude **/*Test.cpp (test everything except files that end with Test.cpp)
    List of patterns can be specified in a file with .lst extension.
    Each line in .lst file is treated as a single pattern.
    Example:
      -include c:/include.lst
      where include.lst contains:
        **/Bank.cpp
        **/ATM/Bank/*.cpp
        c:/ATM/Bank/Bank.cpp
进一步说明:
  • resource参数这里通常是用来指定待测的项目名称,如果需要指定多个项目,建议利用一个.lst文件,在lst文件中,按照如下方式设定需要扫描的项目:
      Shapes
      ATM
      BugTest
 
 
注意:
1) 这里的项目必须是已经导入工作空间的待测试项目,如果不存在,则会报错;
2) 文件中的项目名称不需要使用括号包含;
3) 这里的文件名称必须是.lst结尾。
 
  • include和exclude参数:这个是用来指定具体路径下或固定模式的代码文件或文件夹,一般建议使用.lst文件,在属性文件中设定包含(include)或排除(exclude)的文件进行扫描。通常include.lst文件如下:
              **/Bank.cpp
        **/ATM/Bank/*.cpp
c:/ATM/Bank/*
        c:/ATM/Bank/Bank.cpp
 
 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C语言枚举类型(Enum)深入理解发布时间:2022-07-13
下一篇:
c#怎么更改DataTable中某列的值?发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap