test_timer 0.0.1
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/Manifest.txt +4 -0
- data/README.txt +7 -0
- data/Rakefile +13 -0
- data/lib/test_timer.rb +28 -0
- metadata +57 -0
data/Manifest.txt
ADDED
data/README.txt
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
require 'hoe'
|
4
|
+
|
5
|
+
Hoe.new('Test Timer', '0.0.1') do |p|
|
6
|
+
p.name = "test_timer"
|
7
|
+
p.author = "Geoffrey Grosenbach"
|
8
|
+
p.description = "A Test::Unit hack to print the time each test takes to run."
|
9
|
+
p.email = 'boss@topfunky.com'
|
10
|
+
p.summary = "A Test::Unit hack to print the time each test takes to run."
|
11
|
+
# p.url = "http://nubyonrails.com/pages/gruff"
|
12
|
+
|
13
|
+
end
|
data/lib/test_timer.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
##
|
2
|
+
# EXPERIMENTAL
|
3
|
+
# Show a report of the time each test takes to run
|
4
|
+
|
5
|
+
class Test::Unit::TestSuite
|
6
|
+
|
7
|
+
@@test_benchmarks = {}
|
8
|
+
|
9
|
+
# Runs the tests and/or suites contained in this
|
10
|
+
# TestSuite.
|
11
|
+
def run(result, &progress_block)
|
12
|
+
yield(STARTED, name)
|
13
|
+
@tests.each do |test|
|
14
|
+
start_single_test = Time.now
|
15
|
+
test.run(result, &progress_block)
|
16
|
+
@@test_benchmarks[test.name] = Time.now - start_single_test
|
17
|
+
# print sprintf("#{test.name} %.3f", Time.now - start_single_test) + " "
|
18
|
+
end
|
19
|
+
yield(FINISHED, name)
|
20
|
+
|
21
|
+
puts "\nTEST BENCHMARK REPORT"
|
22
|
+
@@test_benchmarks.keys.sort{|a, b| @@test_benchmarks[a] <=> @@test_benchmarks[b]}.each do |key|
|
23
|
+
value = @@test_benchmarks[key]
|
24
|
+
puts(("%0.3f" % value) + " #{key}") if /^test_/.match(key)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: test_timer
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2006-10-19 00:00:00 -07:00
|
8
|
+
summary: A Test::Unit hack to print the time each test takes to run.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: boss@topfunky.com
|
12
|
+
homepage: http://www.zenspider.com/ZSS/Products/Test Timer/
|
13
|
+
rubyforge_project: test timer
|
14
|
+
description: A Test::Unit hack to print the time each test takes to run.
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Geoffrey Grosenbach
|
31
|
+
files:
|
32
|
+
- Manifest.txt
|
33
|
+
- Rakefile
|
34
|
+
- README.txt
|
35
|
+
- lib/test_timer.rb
|
36
|
+
test_files: []
|
37
|
+
|
38
|
+
rdoc_options: []
|
39
|
+
|
40
|
+
extra_rdoc_files: []
|
41
|
+
|
42
|
+
executables: []
|
43
|
+
|
44
|
+
extensions: []
|
45
|
+
|
46
|
+
requirements: []
|
47
|
+
|
48
|
+
dependencies:
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: hoe
|
51
|
+
version_requirement:
|
52
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.1.1
|
57
|
+
version:
|