crash_monkey 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bin/crash_monkey +4 -3
- data/crash_monkey.gemspec +1 -1
- data/lib/crash_monkey/monkey_runner.rb +8 -0
- data/lib/crash_monkey/templates/config.json +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
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: ./
|
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
@@ -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
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ken Morishita
|