1

随着我们的应用程序接近生产就绪,我们编写了许多规范测试。最初我们bundle exec rspec spec/myspec_spec.rb用于运行单个文件。当我尝试该origen specs命令时,它没有像我预期的那样重新识别该命令。

peologin02:ppekit $ origen specs
Error: Command not recognized: specs
Usage: origen COMMAND [ARGS]

The core origen commands are:
 environment        Display or set the environment (short-cut alias: "e")
 target             Display or set the target (short-cut alias: "t")
 mode               Display or set the mode (short-cut alias: "m")
 plugin             Display or set the plugin (short-cut alias: "pl")
 generate           Generate a test pattern (short-cut alias: "g")
 program            Generate a test program (short-cut alias: "p")
 interactive        Start an interactive Origen console (short-cut alias: "i")
 compile            Compile a template file or directory (short-cut alias: "c")
 exec               Execute any Ruby file with access to your app environment

 rc                 Revision control commands, see -h for details
 save               Save the new or changed files from the last run or a given log file
 lsf                Monitor and manage LSF jobs (short-cut alias: "l")
 web                Web page tools, see -h for details
 time               Tools for test time analysis and forecasting
 lint               Lint and style check (and correct) your application code

我在主网站上没有看到任何关于规格测试的信息。

谢谢

4

1 回答 1

1

新的应用程序模板中包含一个实现origen_specs,但它被注释掉了。

查看您的应用程序config/commands.rb文件,希望这只是取消注释所需行的问题。

origen specs您在 Origen 应用程序和插件中看到的常用命令几乎没有什么魔力- 它只是包装了您已经使用 Origen 命令启动器执行的操作。

该过程将遵循如何在此处添加特定于应用程序的命令的指南:http: //origen-sdk.org/origen/guides/misc/commands/

然后specs命令的内容很简单:

# Run the unit tests  
when "specs"
  require "rspec"
  exit RSpec::Core::Runner.run(['spec'])

以上只是在应用程序的规范目录上以编程方式调用 RSpec,并将 RSpec 的退出代码(即通过/失败)分配给origen命令的结果。

于 2018-03-14T14:17:53.053 回答