test_benchmark 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -0
- data/Manifest.txt +8 -0
- data/README.txt +16 -0
- data/Rakefile +13 -0
- data/about.yml +7 -0
- data/init.rb +1 -0
- data/lib/test_benchmark.rb +26 -0
- metadata +14 -5
data/History.txt
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
== 0.0.3 / 2007-06-24
|
2
|
+
|
3
|
+
* Updated Manifest.txt so files are actually packaged in the gem. D'oh!
|
4
|
+
* See also release notes for version 0.0.2
|
5
|
+
|
6
|
+
== 0.0.2
|
7
|
+
|
8
|
+
* Renamed gem to test_benchmark
|
9
|
+
* Upgraded to Hoe.
|
10
|
+
* Will always show report. If you don't want to see the report, it is recommended that you install the gem and list or comment out "require 'test_benchmark'" to enable the gem.
|
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Test Benchmark
|
2
|
+
==============
|
3
|
+
|
4
|
+
A hack to show a report of how long each test takes to run.
|
5
|
+
|
6
|
+
Useful for troubleshooting slow tests.
|
7
|
+
|
8
|
+
Sample output:
|
9
|
+
|
10
|
+
7.124 test_destroy(FeedTest)
|
11
|
+
7.219 test_create(FeedTest)
|
12
|
+
7.646 test_subscribe_to_auto_discovery(FeedTest)
|
13
|
+
9.339 test_auto_discover_updates_url(FeedTest)
|
14
|
+
9.543 test_find_or_create_by_auto_discover_url(FeedTest)
|
15
|
+
15.780 test_import_from_opml(FeedTest)
|
16
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'hoe'
|
3
|
+
# require './lib/test_benchmark.rb'
|
4
|
+
|
5
|
+
Hoe.new("test_benchmark", '0.0.3') do |p|
|
6
|
+
p.summary = "A plugin for showing how long tests take to run."
|
7
|
+
p.rubyforge_name = 'seattlerb'
|
8
|
+
p.author = 'Geoffrey Grosenbach'
|
9
|
+
p.email = 'boss AT topfunky.com'
|
10
|
+
p.description = 'A simple hack that prints a report of test/unit test runtimes.'
|
11
|
+
p.url = "http://rubyforge.org/projects/seattlerb"
|
12
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
13
|
+
end
|
data/about.yml
ADDED
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.dirname(__FILE__) + "/lib/test_benchmark"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# EXPERIMENTAL
|
2
|
+
# Show a report of the time each test takes to run
|
3
|
+
class Test::Unit::TestSuite
|
4
|
+
|
5
|
+
@@test_benchmarks = {}
|
6
|
+
|
7
|
+
# Runs the tests and/or suites contained in this
|
8
|
+
# TestSuite.
|
9
|
+
def run(result, &progress_block)
|
10
|
+
yield(STARTED, name)
|
11
|
+
@tests.each do |test|
|
12
|
+
start_single_test = Time.now
|
13
|
+
test.run(result, &progress_block)
|
14
|
+
@@test_benchmarks[test.name] = Time.now - start_single_test
|
15
|
+
# print sprintf("#{test.name} %.3f", Time.now - start_single_test) + " "
|
16
|
+
end
|
17
|
+
yield(FINISHED, name)
|
18
|
+
|
19
|
+
puts "\nTEST BENCHMARK REPORT"
|
20
|
+
@@test_benchmarks.keys.sort{|a, b| @@test_benchmarks[a] <=> @@test_benchmarks[b]}.each do |key|
|
21
|
+
value = @@test_benchmarks[key]
|
22
|
+
puts(("%0.3f" % value) + " #{key}") if /^test_/.match(key)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: test_benchmark
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
6
|
+
version: 0.0.3
|
7
7
|
date: 2007-06-24 00:00:00 -07:00
|
8
8
|
summary: A plugin for showing how long tests take to run.
|
9
9
|
require_paths:
|
@@ -28,15 +28,24 @@ cert_chain:
|
|
28
28
|
post_install_message:
|
29
29
|
authors:
|
30
30
|
- Geoffrey Grosenbach
|
31
|
-
files:
|
32
|
-
|
31
|
+
files:
|
32
|
+
- History.txt
|
33
|
+
- Manifest.txt
|
34
|
+
- README.txt
|
35
|
+
- Rakefile
|
36
|
+
- about.yml
|
37
|
+
- init.rb
|
38
|
+
- lib/test_benchmark.rb
|
39
|
+
- test/test_benchmark_test.rb
|
33
40
|
test_files:
|
34
41
|
- test/test_benchmark_test.rb
|
35
42
|
rdoc_options:
|
36
43
|
- --main
|
37
44
|
- README.txt
|
38
|
-
extra_rdoc_files:
|
39
|
-
|
45
|
+
extra_rdoc_files:
|
46
|
+
- History.txt
|
47
|
+
- Manifest.txt
|
48
|
+
- README.txt
|
40
49
|
executables: []
|
41
50
|
|
42
51
|
extensions: []
|