ruby-prof 0.11.0.rc3-x86-mingw32 → 0.11.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,5 +51,5 @@ def run_primes(length=10, maxnum=1000)
51
51
  primes = find_primes(random_array)
52
52
 
53
53
  # Find the largest primes
54
- # largest = find_largest(primes)
54
+ largest = find_largest(primes)
55
55
  end
@@ -6,7 +6,7 @@ require File.expand_path('../test_helper', __FILE__)
6
6
  # -- Tests ----
7
7
  class PrimeTest< Test::Unit::TestCase
8
8
  def test_consistency
9
- result = RubyProf.profile do
9
+ RubyProf.profile do
10
10
  run_primes
11
11
  end
12
12
  end
@@ -50,9 +50,10 @@ class RecursiveTest < Test::Unit::TestCase
50
50
  method.full_name.match(/Fixnum/)
51
51
  end
52
52
 
53
- assert_equal(3, methods.length) # which don't show up in 1.9
53
+ assert_equal(3, methods.length)
54
54
 
55
55
  # Method 0: RecursiveTest#test_simple
56
+ methods.sort!.reverse!
56
57
  method = methods[0]
57
58
  assert_equal('RecursiveTest#test_simple', method.full_name)
58
59
  assert_equal(1, method.called)
@@ -79,16 +80,12 @@ class RecursiveTest < Test::Unit::TestCase
79
80
  assert_equal(2, method.call_infos.length)
80
81
 
81
82
  call_info = method.call_infos.first
82
- if RUBY_VERSION < '1.9'
83
- assert_equal(4, call_info.children.length)
84
- else
85
- assert_equal(2, call_info.children.length)
86
- end
83
+ assert_equal(2 + (RUBY_VERSION < '1.9.0' ? 2 : 0), call_info.children.length)
87
84
  assert_equal('RecursiveTest#test_simple->Object#simple', call_info.call_sequence)
88
85
  assert(!call_info.recursive)
89
86
 
90
87
  call_info = method.call_infos.last
91
- assert_equal(1, call_info.children.length)
88
+ assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 2 : 0), call_info.children.length)
92
89
  assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple', call_info.call_sequence)
93
90
  assert(call_info.recursive)
94
91
 
@@ -112,6 +109,7 @@ class RecursiveTest < Test::Unit::TestCase
112
109
  assert(!call_info.recursive)
113
110
 
114
111
  if RUBY_VERSION < '1.9'
112
+ methods = result.threads.first.methods.dup.sort!.reverse!
115
113
  method = methods[3]
116
114
  assert_equal('Fixnum#-', method.full_name)
117
115
  assert_equal(2, method.called)
@@ -207,7 +205,7 @@ class RecursiveTest < Test::Unit::TestCase
207
205
 
208
206
  call_info = method.call_infos[1]
209
207
  assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial->Integer#times', call_info.call_sequence)
210
- assert_equal(1, call_info.children.length)
208
+ assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
211
209
  assert(call_info.recursive)
212
210
 
213
211
  method = methods[3]
@@ -221,17 +219,17 @@ class RecursiveTest < Test::Unit::TestCase
221
219
  assert_equal(3, method.call_infos.length)
222
220
  call_info = method.call_infos[0]
223
221
  assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial', call_info.call_sequence)
224
- assert_equal(3, call_info.children.length)
222
+ assert_equal(3 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
225
223
  assert(!call_info.recursive)
226
224
 
227
225
  call_info = method.call_infos[1]
228
226
  assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial->Object#render_partial', call_info.call_sequence)
229
- assert_equal(1, call_info.children.length)
227
+ assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
230
228
  assert(call_info.recursive)
231
229
 
232
230
  call_info = method.call_infos[2]
233
231
  assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial->Integer#times->Object#render_partial', call_info.call_sequence)
234
- assert_equal(1, call_info.children.length)
232
+ assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
235
233
  assert(call_info.recursive)
236
234
 
237
235
  method = methods[4]
@@ -24,6 +24,7 @@ require File.expand_path("../test_helper", __FILE__)
24
24
  module_test
25
25
  multi_printer_test
26
26
  no_method_class_test
27
+ pause_test
27
28
  prime_test
28
29
  printers_test
29
30
  recursive_test
@@ -34,5 +35,4 @@ require File.expand_path("../test_helper", __FILE__)
34
35
  thread_test
35
36
  unique_call_path_test).each do |test|
36
37
  require File.expand_path("../#{test}", __FILE__)
37
- end
38
-
38
+ end
@@ -25,14 +25,14 @@ class ThreadTest < Test::Unit::TestCase
25
25
 
26
26
  def test_thread_identity
27
27
  RubyProf.start
28
- thread = Thread.new do
28
+ sleep_thread = Thread.new do
29
29
  sleep(1)
30
30
  end
31
- thread.join
31
+ sleep_thread.join
32
32
  result = RubyProf.stop
33
33
 
34
34
  thread_ids = result.threads.map {|thread| thread.id}.sort
35
- threads = [Thread.current, thread]
35
+ threads = [Thread.current, sleep_thread]
36
36
  assert_equal(2, result.threads.length)
37
37
 
38
38
  assert(thread_ids.include?(threads[0].object_id))
@@ -164,9 +164,9 @@ class ThreadTest < Test::Unit::TestCase
164
164
  end
165
165
 
166
166
  def test_thread
167
- result = RubyProf.profile do
167
+ RubyProf.profile do
168
168
  begin
169
- status = Timeout::timeout(2) do
169
+ Timeout::timeout(2) do
170
170
  while true
171
171
  next
172
172
  end
@@ -17,7 +17,6 @@ class UniqueCallPath
17
17
  end
18
18
 
19
19
  def method_c
20
- c = 3
21
20
  end
22
21
 
23
22
  def method_k(i)
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.rc3
5
- prerelease: 7
4
+ version: 0.11.2
5
+ prerelease:
6
6
  platform: x86-mingw32
7
7
  authors:
8
8
  - Shugo Maeda, Charlie Savage, Roger Pack, Stefan Kaes
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-26 00:00:00.000000000 Z
12
+ date: 2012-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -136,6 +136,8 @@ files:
136
136
  - test/module_test.rb
137
137
  - test/multi_printer_test.rb
138
138
  - test/no_method_class_test.rb
139
+ - test/pause_resume_test.rb
140
+ - test/pause_test.rb
139
141
  - test/prime.rb
140
142
  - test/prime_test.rb
141
143
  - test/printers_test.rb
@@ -144,7 +146,6 @@ files:
144
146
  - test/stack_printer_test.rb
145
147
  - test/stack_test.rb
146
148
  - test/start_stop_test.rb
147
- - test/summarize_test.rb
148
149
  - test/test_helper.rb
149
150
  - test/test_suite.rb
150
151
  - test/thread_test.rb
@@ -166,12 +167,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
167
  required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  none: false
168
169
  requirements:
169
- - - ! '>'
170
+ - - ! '>='
170
171
  - !ruby/object:Gem::Version
171
- version: 1.3.1
172
+ version: '0'
172
173
  requirements: []
173
174
  rubyforge_project:
174
- rubygems_version: 1.8.21
175
+ rubygems_version: 1.8.24
175
176
  signing_key:
176
177
  specification_version: 3
177
178
  summary: Fast Ruby profiler
@@ -1,48 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- require File.expand_path('../test_helper', __FILE__)
5
-
6
- def slow
7
- sleep(3)
8
- end
9
-
10
- def fast
11
- sleep(3)
12
- end
13
-
14
- def slow_caller
15
- 1.times do
16
- slow
17
- end
18
- end
19
-
20
- def fast_caller
21
- 1.times do
22
- fast
23
- end
24
- end
25
-
26
- def parent
27
- [1..10].each do
28
- #slow_caller
29
- fast_caller
30
- end
31
- end
32
-
33
- class SummarizeTest < Test::Unit::TestCase
34
- def setup
35
- # Need to use wall time for this test due to the sleep calls
36
- RubyProf::measure_mode = RubyProf::WALL_TIME
37
- end
38
-
39
- def test
40
- result = RubyProf::Profile.profile do
41
- parent
42
- end
43
-
44
- printer = RubyProf::GraphPrinter.new(result)
45
- printer.print(STDOUT)
46
-
47
- end
48
- end