turn 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,54 +0,0 @@
1
-
2
- if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
3
- require 'spec/rake/verify_rcov'
4
-
5
- namespace :spec do
6
-
7
- desc 'Run all specs with basic output'
8
- Spec::Rake::SpecTask.new(:run) do |t|
9
- t.ruby_opts = PROJ.ruby_opts
10
- t.spec_opts = PROJ.spec.opts
11
- t.spec_files = PROJ.spec.files
12
- t.libs += PROJ.libs
13
- end
14
-
15
- desc 'Run all specs with text output'
16
- Spec::Rake::SpecTask.new(:specdoc) do |t|
17
- t.ruby_opts = PROJ.ruby_opts
18
- t.spec_opts = PROJ.spec.opts + ['--format', 'specdoc']
19
- t.spec_files = PROJ.spec.files
20
- t.libs += PROJ.libs
21
- end
22
-
23
- if HAVE_RCOV
24
- desc 'Run all specs with RCov'
25
- Spec::Rake::SpecTask.new(:rcov) do |t|
26
- t.ruby_opts = PROJ.ruby_opts
27
- t.spec_opts = PROJ.spec.opts
28
- t.spec_files = PROJ.spec.files
29
- t.libs += PROJ.libs
30
- t.rcov = true
31
- t.rcov_dir = PROJ.rcov.dir
32
- t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
33
- end
34
-
35
- RCov::VerifyTask.new(:verify) do |t|
36
- t.threshold = PROJ.rcov.threshold
37
- t.index_html = File.join(PROJ.rcov.dir, 'index.html')
38
- t.require_exact_threshold = PROJ.rcov.threshold_exact
39
- end
40
-
41
- task :verify => :rcov
42
- remove_desc_for_task %w(spec:clobber_rcov)
43
- end
44
-
45
- end # namespace :spec
46
-
47
- desc 'Alias to spec:run'
48
- task :spec => 'spec:run'
49
-
50
- task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
51
-
52
- end # if HAVE_SPEC_RAKE_SPECTASK
53
-
54
- # EOF
@@ -1,47 +0,0 @@
1
-
2
- if HAVE_SVN
3
-
4
- unless PROJ.svn.root
5
- info = %x/svn info ./
6
- m = %r/^Repository Root:\s+(.*)$/.match(info)
7
- PROJ.svn.root = (m.nil? ? '' : m[1])
8
- end
9
- PROJ.svn.root = File.join(PROJ.svn.root, PROJ.svn.path) unless PROJ.svn.path.empty?
10
-
11
- namespace :svn do
12
-
13
- # A prerequisites task that all other tasks depend upon
14
- task :prereqs
15
-
16
- desc 'Show tags from the SVN repository'
17
- task :show_tags => 'svn:prereqs' do |t|
18
- tags = %x/svn list #{File.join(PROJ.svn.root, PROJ.svn.tags)}/
19
- tags.gsub!(%r/\/$/, '')
20
- tags = tags.split("\n").sort {|a,b| b <=> a}
21
- puts tags
22
- end
23
-
24
- desc 'Create a new tag in the SVN repository'
25
- task :create_tag => 'svn:prereqs' do |t|
26
- v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
27
- abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
28
-
29
- svn = PROJ.svn
30
- trunk = File.join(svn.root, svn.trunk)
31
- tag = "%s-%s" % [PROJ.name, PROJ.version]
32
- tag = File.join(svn.root, svn.tags, tag)
33
- msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
34
-
35
- puts "Creating SVN tag '#{tag}'"
36
- unless system "svn cp -m '#{msg}' #{trunk} #{tag}"
37
- abort "Tag creation failed"
38
- end
39
- end
40
-
41
- end # namespace :svn
42
-
43
- task 'gem:release' => 'svn:create_tag'
44
-
45
- end # if PROJ.svn.path
46
-
47
- # EOF
@@ -1,40 +0,0 @@
1
-
2
- if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
3
- require 'rake/testtask'
4
-
5
- namespace :test do
6
-
7
- Rake::TestTask.new(:run) do |t|
8
- t.libs = PROJ.libs
9
- t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
10
- else PROJ.test.files end
11
- t.ruby_opts += PROJ.ruby_opts
12
- t.ruby_opts += PROJ.test.opts
13
- end
14
-
15
- if HAVE_RCOV
16
- desc 'Run rcov on the unit tests'
17
- task :rcov => :clobber_rcov do
18
- opts = PROJ.rcov.opts.dup << '-o' << PROJ.rcov.dir
19
- opts = opts.join(' ')
20
- files = if test(?f, PROJ.test.file) then [PROJ.test.file]
21
- else PROJ.test.files end
22
- files = files.join(' ')
23
- sh "#{RCOV} #{files} #{opts}"
24
- end
25
-
26
- task :clobber_rcov do
27
- rm_r 'coverage' rescue nil
28
- end
29
- end
30
-
31
- end # namespace :test
32
-
33
- desc 'Alias to test:run'
34
- task :test => 'test:run'
35
-
36
- task :clobber => 'test:clobber_rcov' if HAVE_RCOV
37
-
38
- end
39
-
40
- # EOF
@@ -1,36 +0,0 @@
1
- if HAVE_ZENTEST
2
-
3
- # --------------------------------------------------------------------------
4
- if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
5
- require 'autotest'
6
-
7
- namespace :test do
8
- task :autotest do
9
- Autotest.run
10
- end
11
- end
12
-
13
- desc "Run the autotest loop"
14
- task :autotest => 'test:autotest'
15
-
16
- end # if test
17
-
18
- # --------------------------------------------------------------------------
19
- if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
20
- require 'autotest/rspec'
21
-
22
- namespace :spec do
23
- task :autotest do
24
- load '.autotest' if test(?f, '.autotest')
25
- Autotest::Rspec.run
26
- end
27
- end
28
-
29
- desc "Run the autotest loop"
30
- task :autotest => 'spec:autotest'
31
-
32
- end # if rspec
33
-
34
- end # if HAVE_ZENTEST
35
-
36
- # EOF
@@ -1,37 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{turn}
5
- s.version = "0.6.0"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Tim Pease"]
9
- s.date = %q{2009-03-26}
10
- s.default_executable = %q{turn}
11
- s.description = %q{TURN is a new way to view Test::Unit results. With longer running tests, it can be very frustrating to see a failure (....F...) and then have to wait till all the tests finish before you can see what the exact failure was. TURN displays each test on a separate line with failures being displayed immediately instead of at the end of the tests. If you have the 'facets' gem installed, then TURN output will be displayed in wonderful technicolor (but only if your terminal supports ANSI color codes). Well, the only colors are green and red, but that is still color.}
12
- s.email = %q{tim.pease@gmail.com}
13
- s.executables = ["turn"]
14
- s.extra_rdoc_files = ["History.txt", "README.txt", "Release.txt", "bin/turn"]
15
- s.files = ["History.txt", "README.txt", "Rakefile", "Release.txt", "VERSION", "bin/turn", "lib/turn.rb", "lib/turn/colorize.rb", "lib/turn/command.rb", "lib/turn/components/case.rb", "lib/turn/components/method.rb", "lib/turn/components/suite.rb", "lib/turn/controller.rb", "lib/turn/reporter.rb", "lib/turn/reporters/dot_reporter.rb", "lib/turn/reporters/marshal_reporter.rb", "lib/turn/reporters/outline_reporter.rb", "lib/turn/reporters/progress_reporter.rb", "lib/turn/runners/crossrunner.rb", "lib/turn/runners/isorunner.rb", "lib/turn/runners/loadrunner.rb", "lib/turn/runners/solorunner.rb", "lib/turn/runners/testrunner.rb", "test/test_example.rb", "test/test_sample.rb", "turn.gemspec", "work/quicktest.rb", "work/turn.rb"]
16
- s.has_rdoc = true
17
- s.homepage = %q{http://codeforpeople.rubyforge.org/turn}
18
- s.rdoc_options = ["--main", "README.txt"]
19
- s.require_paths = ["lib"]
20
- s.rubyforge_project = %q{codeforpeople}
21
- s.rubygems_version = %q{1.3.1}
22
- s.summary = %q{Test::Unit Reporter (New) -- new output format for Test::Unit}
23
- s.test_files = ["test/test_example.rb", "test/test_sample.rb"]
24
-
25
- if s.respond_to? :specification_version then
26
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
- s.specification_version = 2
28
-
29
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
- s.add_development_dependency(%q<bones>, [">= 2.4.2"])
31
- else
32
- s.add_dependency(%q<bones>, [">= 2.4.2"])
33
- end
34
- else
35
- s.add_dependency(%q<bones>, [">= 2.4.2"])
36
- end
37
- end
@@ -1,42 +0,0 @@
1
- # Christian Neukirchen
2
-
3
- # This could actually be quite usable if it weren't for one small problem:
4
- # There is no way to close off blocks from the outside scope.
5
- # This can cause interferance between separate tests.
6
- # So while quicktest works for simple cases, it may well run into
7
- # problems with anything sizable.
8
-
9
- require 'test/unit'
10
-
11
- $TCGEN = "000000"
12
- $TGEN = "000000"
13
-
14
- #$TS = []
15
- $TC = [nil]
16
-
17
- def testcase(name=nil, &block)
18
- tc = Class.new(Test::Unit::TestCase)
19
- #self.class.const_set("TC_#{(name||$TCGEN.succ!)}", tc)
20
- $TC << tc
21
- tc.class_eval &block
22
- end
23
-
24
- class Test::Unit::TestCase
25
- def self.gen_test_name
26
- @gen_test_name ||= "000000"
27
- @gen_test_name.succ!
28
- return "#{@gen_test_name}"
29
- end
30
- def self.test(name=nil, &block)
31
- __send__(:define_method, "test_#{(name||gen_test_name)}", &block)
32
- end
33
- end
34
-
35
- def test(name=nil, &block)
36
- $TC[0] ||= Class.new(Test::Unit::TestCase)
37
- self.class.const_set("TC#{$TCGEN.succ!}", $TC[0])
38
- $TC[0].__send__(:define_method, "test_#{(name||$TGEN.succ!)}", &block)
39
- end
40
-
41
-
42
- #Test::Unit.run = !$DEBUG
@@ -1,119 +0,0 @@
1
- require 'test/unit/ui/console/testrunner'
2
- require 'turn/colorize'
3
-
4
- require 'turn/components/suite.rb'
5
- require 'turn/components/case.rb'
6
- require 'turn/components/method.rb'
7
-
8
- require 'turn/reporters/outline_reporter.rb'
9
- require 'turn/reporters/progress_reporter.rb'
10
-
11
- #$turn_reporter = Turn::ProgressReporter.new(@io)
12
- $turn_reporter = Turn::OutlineReporter.new(@io)
13
-
14
- module ::Test::Unit
15
- module UI
16
- module Console
17
- class TestRunner
18
- include Turn::Colorize
19
-
20
- # Is this needed?
21
- alias :t_attach_to_mediator :attach_to_mediator
22
-
23
- def attach_to_mediator
24
- @mediator.add_listener(TestRunnerMediator::STARTED, &method(:t_started))
25
- @mediator.add_listener(TestRunnerMediator::FINISHED, &method(:t_finished))
26
- @mediator.add_listener(TestSuite::STARTED, &method(:t_case_started))
27
- @mediator.add_listener(TestSuite::FINISHED, &method(:t_case_finished))
28
- @mediator.add_listener(TestCase::STARTED, &method(:t_test_started))
29
- @mediator.add_listener(TestCase::FINISHED, &method(:t_test_finished))
30
- @mediator.add_listener(TestResult::FAULT, &method(:t_fault))
31
-
32
- @io.sync = true
33
-
34
- @t_result = nil
35
- @t_fault = nil
36
- @t_reporter = $turn_reporter
37
-
38
- @t_previous_run_count = 0
39
- @t_previous_error_count = 0
40
- @t_previous_failure_count = 0
41
- @t_previous_assertion_count = 0
42
- end
43
-
44
- def t_started(result)
45
- @t_suite = Turn::TestSuite.new #@suite
46
- @t_suite.size = @suite.size
47
- @t_result = result
48
- @t_reporter.start_suite(@t_suite)
49
- end
50
-
51
- def t_case_started(name)
52
- (@not_first_case = true; return) unless @not_first_case
53
- @t_case = @t_suite.new_case(name)
54
- @t_reporter.start_case(@t_case)
55
- end
56
-
57
- def t_test_started(name)
58
- methname, tcase = name.scan(%r/^([^\(]+)\(([^\)]+)\)/o).flatten!
59
- @t_test = @t_case.new_test(methname)
60
- #@t_test.file = tcase
61
- #@t_test.name = method
62
- @t_reporter.start_test(@t_test)
63
- end
64
-
65
- def t_fault(fault)
66
- case fault
67
- when ::Test::Unit::Error
68
- msg = "\t"
69
- msg << fault.to_s.split("\n")[2..-1].join("\n\t")
70
- msg = ::ANSICode.magenta(msg) if COLORIZE
71
- @t_test.error!(msg)
72
- @t_reporter.error(msg)
73
- when ::Test::Unit::Failure
74
- msg = "\t"
75
- msg << fault.location[0] << "\n\t"
76
- msg << fault.message.gsub("\n","\n\t")
77
- msg = ::ANSICode.magenta(msg) if COLORIZE
78
- @t_test.fail!(msg)
79
- @t_reporter.fail(msg)
80
- end
81
- end
82
-
83
- def t_test_finished(name)
84
- @t_reporter.pass if @t_test.pass?
85
- @t_reporter.finish_test(@t_test)
86
- end
87
-
88
- def t_case_finished(name)
89
- t = @t_result.run_count - @t_previous_run_count
90
- f = @t_result.failure_count - @t_previous_failure_count
91
- e = @t_result.error_count - @t_previous_error_count
92
- a = @t_result.assertion_count - @t_previous_assertion_count
93
-
94
- @t_case.counts(t,a,f,e)
95
-
96
- @t_previous_run_count = @t_result.run_count
97
- @t_previous_failure_count = @t_result.failure_count
98
- @t_previous_error_count = @t_result.error_count
99
- @t_previous_assertion_count = @t_result.assertion_count
100
-
101
- @t_reporter.finish_case(@t_case)
102
- end
103
-
104
- def t_finished(elapsed_time)
105
- @t_suite.count_tests = @t_result.run_count
106
- @t_suite.count_failures = @t_result.failure_count
107
- @t_suite.count_errors = @t_result.error_count
108
- @t_suite.count_passes = @t_result.run_count - @t_result.failure_count - @t_result.error_count
109
- @t_suite.count_assertions = @t_result.assertion_count
110
-
111
- @t_reporter.finish_suite(@t_suite)
112
- end
113
-
114
- end
115
- end
116
- end
117
- end
118
-
119
- # EOF