crash_monkey 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
data/bin/crash_monkey CHANGED
@@ -11,14 +11,15 @@ opts = {}
11
11
  ARGV.options do |o|
12
12
  o.on('-a app_name', 'Target Application(Required)') {|b| opts[:app_path] = b}
13
13
  o.on('-n run_count', 'How many times monkeys run(default: 2)') {|b| opts[:run_count] = b.to_i}
14
- o.on('-d result_dir', 'Where to output result(default: ./crash_monkey)') {|b| opts[:result_base_dir] = File.expand_path(b)}
14
+ o.on('-d result_dir', 'Where to output result(default: ./crash_monkey_result)') {|b| opts[:result_base_dir] = File.expand_path(b)}
15
15
  o.on('-t time_limit_sec', 'Time limit of running(default: 100 sec)') {|b| opts[:time_limit_sec] = b.to_i}
16
16
  o.on('-c config_path', 'Configuration JSON Path') {|b| opts[:config_path] = File.expand_path(b)}
17
17
  o.on('--show-config', 'Show Current Configuration JSON') {|_| opts[:show_config] = true}
18
+ o.on('--list-app', 'Show List of Installed Apps in iOS Simulator') {|_| opts[:list_app] = true}
18
19
  o.parse!
19
20
  end
20
21
 
21
- unless opts[:app_path] || opts[:show_config]
22
+ unless opts[:app_path] || opts[:show_config] || opts[:list_app]
22
23
  puts ARGV.options.help
23
24
  exit(1)
24
25
  end
@@ -28,6 +29,6 @@ opts[:time_limit_sec] ||= 100
28
29
 
29
30
  result_ok = UIAutoMonkey::MonkeyRunner.new.run(opts)
30
31
 
31
- puts result_ok ? 'EXIT 0' : 'EXIT 1' unless opts[:show_config]
32
+ puts result_ok ? 'EXIT 0' : 'EXIT 1' unless opts[:show_config] || opts[:list_app]
32
33
 
33
34
  exit(result_ok ? 0 : 1)
data/crash_monkey.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{crash_monkey}
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ken Morishita"]
@@ -20,7 +20,11 @@ module UIAutoMonkey
20
20
  if @options[:show_config]
21
21
  show_config
22
22
  return true
23
+ elsif @options[:list_app]
24
+ list_app
25
+ return true
23
26
  end
27
+ ###########
24
28
  log @options.inspect
25
29
  FileUtils.remove_dir(result_base_dir, true)
26
30
  FileUtils.makedirs(result_base_dir)
@@ -114,6 +118,10 @@ module UIAutoMonkey
114
118
  puts File.read(config_json_path)
115
119
  end
116
120
 
121
+ def list_app
122
+ puts find_apps('*.app').map{|n| File.basename n}.uniq.sort.join("\n")
123
+ end
124
+
117
125
  def log(msg)
118
126
  puts msg
119
127
  end
@@ -1,5 +1,5 @@
1
1
  {
2
- "numberOfEvents": 1000,
2
+ "numberOfEvents": 100000,
3
3
  "delayBetweenEvents": 0.05,
4
4
  "result_detail_event_num": 20,
5
5
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crash_monkey
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Morishita