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

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
 
 

原文链接: https://www.cnblogs.com/kwang-cai/p/5180487.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

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

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/228352

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月13日 下午1:56
下一篇 2023年2月13日 下午1:56

相关推荐