run_loop 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/run_loop/core.rb CHANGED
@@ -36,6 +36,11 @@ module RunLoop
36
36
  results_dir_trace = File.join(results_dir, "trace")
37
37
  FileUtils.mkdir_p(results_dir_trace)
38
38
 
39
+ dependencies = options[:dependencies] || []
40
+ dependencies.each do |dep|
41
+ FileUtils.cp(dep, results_dir)
42
+ end
43
+
39
44
  script = File.join(results_dir, "_run_loop.js")
40
45
 
41
46
 
@@ -85,8 +90,8 @@ module RunLoop
85
90
 
86
91
  end
87
92
 
88
-
89
93
  log_file = File.join(results_dir, 'run_loop.out')
94
+
90
95
  cmd = instruments_command(udid, results_dir_trace, bundle_dir_or_bundle_id, results_dir, script, log_file)
91
96
 
92
97
  pid = fork do
@@ -134,6 +139,9 @@ module RunLoop
134
139
  tmp_cmd = File.join(File.dirname(repl_path), '__repl-cmd.txt')
135
140
  File.open(tmp_cmd, "w") do |f|
136
141
  f.write("#{index}:#{cmd}")
142
+ if ENV['DEBUG']
143
+ puts "Wrote: #{index}:#{cmd}"
144
+ end
137
145
  end
138
146
 
139
147
  FileUtils.mv(tmp_cmd, repl_path)
@@ -183,10 +191,8 @@ module RunLoop
183
191
  break
184
192
  end
185
193
  else
186
-
194
+ sleep(0.2)
187
195
  end
188
-
189
- sleep(0.5)
190
196
  end
191
197
  result
192
198
 
@@ -210,15 +216,18 @@ module RunLoop
210
216
  if udid
211
217
  instruments_path = "#{instruments_path} -w #{udid}"
212
218
  end
213
- [
219
+ cmd = [
214
220
  instruments_path,
215
221
  "-D", results_dir_trace,
216
222
  "-t", automation_template,
217
223
  "\"#{bundle_dir_or_bundle_id}\"",
218
224
  "-e", "UIARESULTSPATH", results_dir,
219
- "-e", "UIASCRIPT", script,
220
- "&> #{log_file}"
225
+ "-e", "UIASCRIPT", script
221
226
  ]
227
+ if log_file
228
+ cmd << "&> #{log_file}"
229
+ end
230
+ cmd
222
231
  end
223
232
 
224
233
  def self.automation_template
@@ -315,4 +324,4 @@ module RunLoop
315
324
  script
316
325
  end
317
326
 
318
- end
327
+ end
@@ -1,3 +1,3 @@
1
1
  module RunLoop
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-03 00:00:00.000000000 Z
12
+ date: 2013-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor