Sha256: a3c40e991378b3ec2b2c2ab3b633d891a43b1e79e4762bd559a6e30521421004

Contents?: true

Size: 1.42 KB

Versions: 2

Compression:

Stored size: 1.42 KB

Contents

#!/usr/bin/env ruby

Version = File.read(File.expand_path('../../VERSION', __FILE__))

require 'optparse'

$: << File.dirname(__FILE__) + '/../lib'
require 'crash_monkey'

opts = {}
ARGV.options do |o|
  o.on('-a app_name', 'Target Application(Required)') {|b| opts[:app_path] = b}
  o.on('-n run_count', 'How many times monkeys run(default: 2)') {|b| opts[:run_count] = b.to_i}
  o.on('-d result_dir', 'Where to output result(default: ./crash_monkey_result)') {|b| opts[:result_base_dir] = File.expand_path(b)}
  o.on('-t time_limit_sec', 'Time limit of running(default: 100 sec)') {|b| opts[:time_limit_sec] = b.to_i}
  o.on('-c config_path', 'Configuration JSON Path') {|b| opts[:config_path] = File.expand_path(b)}
  o.on('-e extend_javascript_path', 'Extend Uiautomation Javascript for such Login scripts') {|b| opts[:extend_javascript_path] = File.expand_path(b)}
  o.on('--show-config', 'Show Current Configuration JSON') {|_| opts[:show_config] = true}
  o.on('--list-app', 'Show List of Installed Apps in iOS Simulator') {|_| opts[:list_app] = true}
  o.on('--reset-iPhone-Simulator', 'Reset iPhone Simulator')
  o.parse!
end

unless opts[:app_path] || opts[:show_config] || opts[:list_app]
  puts ARGV.options.help
  exit(1)
end

opts[:run_count] ||= 2
opts[:time_limit_sec] ||= 100

result_ok = UIAutoMonkey::MonkeyRunner.new.run(opts)

puts result_ok ? 'EXIT 0' : 'EXIT 1' unless opts[:show_config] || opts[:list_app]

exit(result_ok ? 0 : 1)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crash_monkey-0.2.1 bin/crash_monkey
crash_monkey-0.2.0 bin/crash_monkey