-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
151 lines (132 loc) · 5.33 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
require 'rake/clean'
$:.unshift File.join(File.dirname(__FILE__), 'lib')
require 'fittask'
desc "Run Fit TaskLib"
Rake::FitTask.new(:fit) do |t|
# t.libs = ["lib/fit/*.rb"] # the fixture directory goes here
t.fail_on_failed_test = true
t.create_test_suite do |suite|
suite.test_path = 'doc/fitnesse/'
suite.report_path = 'doc/fitnesse/reports/'
test_files = Dir.glob(suite.test_path + '/*.html')
suite.tests = test_files.collect do |test_file|
{ :name => File.basename(test_file, '.html') }
end
end
examples = []
examples << { :name => 'arithmetic',
:right => 39, :wrong => 8, :ignores => 0, :exceptions => 2 }
examples << { :name => 'BinaryChop',
:right => 95, :wrong => 0, :ignores => 0, :exceptions => 0 }
examples << { :name => 'CalculatorExample',
:right => 75, :wrong => 9, :ignores => 0, :exceptions => 0 }
examples << { :name => 'MusicExample',
:right => 95, :wrong => 0, :ignores => 0, :exceptions => 0 }
examples << { :name => 'MusicExampleWithErrors',
:right => 54, :wrong => 10, :ignores => 0, :exceptions => 0 }
# WebPageExample is not here because it needs an active Internet connection
examples << { :name => 'NetworkExample',
:right => 5, :wrong => 0, :ignores => 0, :exceptions => 0 }
examples << { :name => 'ColumnIndex',
:right => 51, :wrong => 3, :ignores => 8, :exceptions => 0 }
examples << { :name => 'AllFiles',
:right => 9, :wrong => 3, :ignores => 0, :exceptions => 0 }
examples << { :name => 'AllCombinations',
:right => 72, :wrong => 14, :ignores => 0, :exceptions => 0 }
examples << { :name => 'AllPairs',
:right => 39, :wrong => 9, :ignores => 0, :exceptions => 0 }
# Running the ExampleTests.html file is roughly equivalent to this test suite
t.create_test_suite do |suite|
suite.test_path = "doc/examples/"
suite.report_path = "doc/reports/"
suite.tests = examples
end
t.test_suites.each do |suite|
CLOBBER.include(suite.report_path + "Report_*.html")
CLOBBER.include(suite.report_path + "footnotes/")
end
end
# desc 'Run tests from the book "Fit for developing software" by R.Mugridge & W.Cunningham'
Rake::FitTask.new(:fitbook) do |t|
# Examples from the book "Fit for developing software" by R.Mugridge & W.Cunningham
t.create_test_suite do |suite|
tests = []
tests << { :name => 'TestDiscount',
:right => 7, :wrong => 1, :ignores => 0, :exceptions => 0 }
tests << { :name => 'TestDiscountMoney',
:right => 7, :wrong => 1, :ignores => 0, :exceptions => 0 }
tests << { :name => 'TestChatServer' }
tests << { :name => 'TestDiscountGroup' }
tests << { :name => 'TestLateHours' }
suite.test_path = "doc/book/"
suite.report_path = "doc/book/"
suite.tests = tests
CLOBBER.include(suite.report_path + "Report_*.html")
CLOBBER.include(suite.report_path + "footnotes/")
end
end
Rake::FitTask.new(:fitbugs) do |t|
t.create_test_suite do |suite|
suite.test_path = "doc/bugs/"
suite.report_path = "doc/bugs/"
suite << { :name => 'ColumnFixtureFollowedByActionFixture',
:right => 8, :wrong => 1, :ignores => 0, :exceptions => 0 }
end
end
Rake::FitTask.new(:fitspec) do |t|
t.create_test_suite do |suite|
suite.test_path = "doc/spec/"
suite.report_path = "doc/spec/"
suite << { :name => 'parse',
:right => 83, :wrong => 0, :ignores => 0, :exceptions => 0 }
suite << { :name => 'annotation',
:right => 47, :wrong => 0, :ignores => 0, :exceptions => 0 }
suite << { :name => 'ui',
:right => 30, :wrong => 0, :ignores => 0, :exceptions => 0 }
end
end
require 'rake/testtask'
desc "Default task is to run FIT unit tests."
task :default => :test
desc "Run FIT unit tests."
Rake::TestTask.new do |t|
t.test_files = FileList['test/all_tests.rb']
t.verbose = true
t.libs = ['lib','test'] # verify why is needed
end
### RubyGems related stuff
require 'rake/gempackagetask'
require 'fit/version'
spec = Gem::Specification.new do |s|
s.name = 'fit'
s.version = Fit::VERSION
s.author = 'Giulio Piancastelli'
# See the README for other authors/developers/contributors
s.email = 'giulio.piancastelli@gmail.com'
s.homepage = 'http://fit.rubyforge.org/'
s.rubyforge_project = 'fit'
s.platform = Gem::Platform::RUBY
s.summary = 'A Ruby port of FIT (Framework for Integrated Testing)'
s.description = <<EOF_DESCRIPTION
RubyFIT is a tool for enhancing communication and collaboration in
software development. It allows customers, testers, and programmers
to learn what their software should do and what it does do, by
automatically comparing customers' expectations to actual results.
EOF_DESCRIPTION
s.files = FileList["{bin,lib,test,doc}/**/*"].to_a + ["Rakefile", "CHANGELOG"]
s.require_path = 'lib'
# s.autorequire something?
# set for executable scripts in the bin/ subdirectory
s.bindir = 'bin'
s.executables << 'fit'
s.test_file = 'test/all_tests.rb'
s.has_rdoc = false # no RDoc comments in the code
s.extra_rdoc_files = ["README.rdoc"]
# no external dependencies on other gems
end
# Cygwin's ln fails under my Windows installation
FileUtils::LN_SUPPORTED[0] = false
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
pkg.need_zip = true
end