Sha256: 26e16b8990a6451119f081f9a04ea6f466d02ebf3e6d42ebe6817be8bc67c069

Contents?: true

Size: 1.79 KB

Versions: 39

Compression:

Stored size: 1.79 KB

Contents

require 'optparse'
require 'pathname'

options = {}

opt_parser = OptionParser.new do |opts|
  opts.banner = <<-EOT
Run (execute a flow) of the last test program generated for the given target.

Usage: origen testers:run FLOW [options]
  EOT
  opts.on('--enable FLAG,FLAG', Array, 'Comma-separated list of flow flags to enable') { |flags| options[:flow_flags] = flags }
  opts.on('--job NAME', String, 'Job name to enable') { |job| options[:job] = job }
  opts.on('--fail ID,ID', Array, 'Comma-separated list of test IDs to fail') { |ids| options[:failed_test_ids] = ids }
  opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
  opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
  opts.on('-d', '--debugger', 'Enable the debugger') {  options[:debugger] = true }
  opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', '  ' + Origen::Mode::MODES.join(', ')) { |_m| }
  opts.separator ''
  opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
end

opt_parser.parse! ARGV

Origen.environment.temporary = options[:environment] if options[:environment]
Origen.target.temporary = options[:target] if options[:target]
# Origen.app.load_target!

program =  OrigenTesters.program

unless program
  puts 'Sorry, but there is no program model available for the current target, generate the program then retry'
  exit 1
end

flow = ARGV.first

unless flow
  puts 'You must supply the name of the flow to execute, the current program has these flows'
  puts OrigenTesters.program.flows.keys
  exit 1
end

OrigenTesters.program.flows[flow.to_sym].run(options)

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
origen_testers-0.9.8 lib/commands/run.rb
origen_testers-0.9.7 lib/commands/run.rb
origen_testers-0.9.6 lib/commands/run.rb
origen_testers-0.9.5 lib/commands/run.rb
origen_testers-0.9.4 lib/commands/run.rb
origen_testers-0.9.3 lib/commands/run.rb
origen_testers-0.9.2 lib/commands/run.rb
origen_testers-0.9.1 lib/commands/run.rb
origen_testers-0.9.0 lib/commands/run.rb
origen_testers-0.8.13 lib/commands/run.rb
origen_testers-0.8.11 lib/commands/run.rb
origen_testers-0.8.8 lib/commands/run.rb
origen_testers-0.8.7 lib/commands/run.rb
origen_testers-0.8.6 lib/commands/run.rb
origen_testers-0.8.5 lib/commands/run.rb
origen_testers-0.8.4 lib/commands/run.rb
origen_testers-0.8.3 lib/commands/run.rb
origen_testers-0.8.2 lib/commands/run.rb
origen_testers-0.8.1 lib/commands/run.rb
origen_testers-0.8.0 lib/commands/run.rb