albacore 0.0.9 → 0.1.0
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/README.markdown +84 -81
- data/VERSION +1 -1
- data/install_dependencies.rb +10 -10
- data/lib/albacore.rb +10 -2
- data/lib/albacore/assemblyinfo.rb +100 -100
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
- data/lib/albacore/docu.rb +39 -0
- data/lib/albacore/exec.rb +23 -0
- data/lib/albacore/expandtemplates.rb +73 -71
- data/lib/albacore/msbuild.rb +56 -61
- data/lib/albacore/mspectestrunner.rb +44 -42
- data/lib/albacore/nant.rb +39 -0
- data/lib/albacore/ncoverconsole.rb +68 -61
- data/lib/albacore/ncoverreport.rb +56 -55
- data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
- data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/classfilter.rb +5 -5
- data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
- data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
- data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
- data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
- data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
- data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
- data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
- data/lib/albacore/ndepend.rb +35 -0
- data/lib/albacore/nunittestrunner.rb +36 -35
- data/lib/albacore/plink.rb +48 -0
- data/lib/albacore/sftp.rb +33 -31
- data/lib/albacore/sqlcmd.rb +54 -51
- data/lib/albacore/ssh.rb +35 -33
- data/lib/albacore/support/albacore_helper.rb +1 -4
- data/lib/albacore/support/attrmethods.rb +25 -0
- data/lib/albacore/support/failure.rb +17 -17
- data/lib/albacore/support/globalconfig.rb +6 -0
- data/lib/albacore/support/logging.rb +30 -28
- data/lib/albacore/support/runcommand.rb +41 -41
- data/lib/albacore/support/yamlconfig.rb +23 -27
- data/lib/albacore/unzip.rb +28 -0
- data/lib/albacore/xbuild.rb +54 -0
- data/lib/albacore/xunittestrunner.rb +40 -43
- data/lib/albacore/zipdirectory.rb +72 -63
- data/lib/rake/assemblyinfotask.rb +12 -11
- data/lib/rake/docutask.rb +17 -0
- data/lib/rake/exectask.rb +18 -0
- data/lib/rake/expandtemplatestask.rb +12 -11
- data/lib/rake/msbuildtask.rb +13 -12
- data/lib/rake/mspectask.rb +12 -11
- data/lib/rake/nanttask.rb +17 -0
- data/lib/rake/ncoverconsoletask.rb +12 -11
- data/lib/rake/ncoverreporttask.rb +12 -11
- data/lib/rake/ndependtask.rb +23 -0
- data/lib/rake/nunittask.rb +12 -11
- data/lib/rake/plinktask.rb +23 -0
- data/lib/rake/renametask.rb +15 -15
- data/lib/rake/sftptask.rb +11 -10
- data/lib/rake/sqlcmdtask.rb +13 -12
- data/lib/rake/sshtask.rb +11 -10
- data/lib/rake/support/albacoretask.rb +16 -15
- data/lib/rake/unziptask.rb +17 -0
- data/lib/rake/xbuildtask.rb +22 -0
- data/lib/rake/xunittask.rb +12 -11
- data/lib/rake/ziptask.rb +12 -11
- data/rakefile.rb +255 -204
- data/spec/assemblyinfo_spec.rb +426 -221
- data/spec/assemblyinfotask_spec.rb +21 -21
- data/spec/docu_spec.rb +70 -0
- data/spec/docutask_spec.rb +39 -0
- data/spec/exec_spec.rb +23 -0
- data/spec/exectask_spec.rb +31 -0
- data/spec/expandtemplates_spec.rb +149 -148
- data/spec/expandtemplatestask_spec.rb +21 -21
- data/spec/msbuild_spec.rb +150 -139
- data/spec/msbuildtask_spec.rb +21 -21
- data/spec/mspectask_spec.rb +21 -21
- data/spec/nant_spec.rb +101 -0
- data/spec/nanttask_spec.rb +31 -0
- data/spec/ncoverconsole_spec.rb +253 -221
- data/spec/ncoverconsoletask_spec.rb +21 -21
- data/spec/ncoverreport_spec.rb +538 -523
- data/spec/ncoverreporttask_spec.rb +21 -21
- data/spec/ndepend_spec.rb +49 -0
- data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
- data/spec/nunittask_spec.rb +21 -21
- data/spec/nunittestrunner_spec.rb +6 -6
- data/spec/patches/docu_patch.rb +13 -0
- data/spec/patches/system_patch.rb +18 -18
- data/spec/patches/tasklib_patch.rb +10 -10
- data/spec/plink_spec.rb +61 -0
- data/spec/plinktask_spec.rb +31 -0
- data/spec/renametask_spec.rb +21 -21
- data/spec/sftp_spec.rb +24 -24
- data/spec/sftptask_spec.rb +31 -31
- data/spec/sqlcmd_spec.rb +118 -120
- data/spec/sqlcmdtask_spec.rb +21 -21
- data/spec/ssh_spec.rb +36 -37
- data/spec/sshtask_spec.rb +29 -29
- data/spec/support/TestSolution/NDependProject.xml +315 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
- data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
- data/spec/support/TestSolution/TestSolution.build +25 -0
- data/spec/support/assemblyinfotester.rb +40 -38
- data/spec/support/expandtemplatestestdata.rb +73 -73
- data/spec/support/msbuildtestdata.rb +28 -28
- data/spec/support/nanttestdata.rb +33 -0
- data/spec/support/ncoverconsoletestdata.rb +18 -0
- data/spec/support/ncoverreporttestdata.rb +24 -24
- data/spec/support/spec_helper.rb +2 -1
- data/spec/support/yamlconfig/msbuild.yml +3 -0
- data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
- data/spec/support/ziptestdata.rb +11 -6
- data/spec/xunit_spec.rb +63 -0
- data/spec/xunittask_spec.rb +19 -19
- data/spec/yamlconfig_spec.rb +38 -52
- data/spec/zip_spec.rb +56 -11
- data/spec/ziptask_spec.rb +22 -22
- metadata +53 -8
- data/lib/albacore/command.rb +0 -23
- data/lib/rake/commandtask.rb +0 -16
- data/spec/command_spec.rb +0 -23
@@ -4,28 +4,28 @@ require 'rake/ncoverconsoletask'
|
|
4
4
|
require 'tasklib_patch'
|
5
5
|
|
6
6
|
describe Albacore::NCoverConsoleTask, "when running" do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
before :all do
|
8
|
+
task = Albacore::NCoverConsoleTask.new(:ncoverconsole) do |t|
|
9
|
+
@yielded_object = t
|
10
|
+
end
|
11
|
+
task.extend(TasklibPatch)
|
12
|
+
Rake::Task[:ncoverconsole].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should yield the ncover console api" do
|
16
|
+
@yielded_object.kind_of?(NCoverConsole).should == true
|
17
|
+
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe Albacore::NCoverConsoleTask, "when execution fails" do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
before :all do
|
22
|
+
@task = Albacore::NCoverConsoleTask.new(:failingtask)
|
23
|
+
@task.extend(TasklibPatch)
|
24
|
+
@task.fail
|
25
|
+
Rake::Task["failingtask"].invoke
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should fail the rake task" do
|
29
|
+
@task.task_failed.should == true
|
30
|
+
end
|
31
31
|
end
|
data/spec/ncoverreport_spec.rb
CHANGED
@@ -3,575 +3,590 @@ require 'albacore/ncoverreport'
|
|
3
3
|
require 'ncoverreporttestdata'
|
4
4
|
|
5
5
|
describe NCoverReport, "when runnign without the ncover report location specified" do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
before :all do
|
7
|
+
@ncover = NCoverReport.new
|
8
|
+
@ncover.run
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should fail execution" do
|
12
|
+
@ncover.failed.should be_true
|
13
|
+
end
|
14
14
|
end
|
15
15
|
|
16
16
|
describe NCoverReport, "when running a full coverage report with a specified output folder" do
|
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
|
-
|
17
|
+
before :all do
|
18
|
+
NCoverReportTestData.clean_output_folder
|
19
|
+
|
20
|
+
@ncover = NCoverReport.new
|
21
|
+
@ncover.extend(SystemPatch)
|
22
|
+
@ncover.log_level = :verbose
|
23
|
+
|
24
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
25
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
26
|
+
|
27
|
+
fullcoveragereport = NCover::FullCoverageReport.new()
|
28
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
29
|
+
@ncover.reports fullcoveragereport
|
30
|
+
|
31
|
+
@ncover.run
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should execute ncover.reporting" do
|
35
|
+
@ncover.system_command.should include(NCoverReportTestData.path_to_command)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
|
39
|
+
@ncover.system_command.should include("//or FullCoverageReport:Html:\"#{NCoverReportTestData.output_folder}\"")
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should produce the report" do
|
43
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
44
|
+
end
|
45
45
|
end
|
46
46
|
|
47
47
|
describe NCoverReport, "when running a summary report with a specified output folder" do
|
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
|
-
|
48
|
+
before :all do
|
49
|
+
NCoverReportTestData.clean_output_folder
|
50
|
+
|
51
|
+
@ncover = NCoverReport.new
|
52
|
+
@ncover.extend(SystemPatch)
|
53
|
+
@ncover.log_level = :verbose
|
54
|
+
|
55
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
56
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
57
|
+
|
58
|
+
summaryreport = NCover::SummaryReport.new()
|
59
|
+
summaryreport.output_path = NCoverReportTestData.summary_output_file
|
60
|
+
@ncover.reports summaryreport
|
61
|
+
|
62
|
+
@ncover.run
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should execute ncover.reporting" do
|
66
|
+
@ncover.system_command.should include(NCoverReportTestData.path_to_command)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should tell ncover.reporting to produce a summary html report in the specified folder" do
|
70
|
+
@ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should produce the report" do
|
74
|
+
File.exist?(NCoverReportTestData.summary_output_file).should be_true
|
75
|
+
end
|
76
76
|
end
|
77
77
|
|
78
78
|
describe NCoverReport, "when running multiple ncover reports - a summary and a full coverage report" do
|
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
|
-
end
|
79
|
+
before :all do
|
80
|
+
NCoverReportTestData.clean_output_folder
|
81
|
+
|
82
|
+
@ncover = NCoverReport.new
|
83
|
+
@ncover.extend(SystemPatch)
|
84
|
+
@ncover.log_level = :verbose
|
85
|
+
|
86
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
87
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
88
|
+
|
89
|
+
summaryreport = NCover::SummaryReport.new()
|
90
|
+
summaryreport.output_path = NCoverReportTestData.summary_output_file
|
91
|
+
|
92
|
+
fullcoveragereport = NCover::FullCoverageReport.new()
|
93
|
+
@fullcoverage_output_folder = File.join(NCoverReportTestData.output_folder, "fullcoverage")
|
94
|
+
fullcoveragereport.output_path = @fullcoverage_output_folder
|
95
|
+
@ncover.reports summaryreport, fullcoveragereport
|
96
|
+
|
97
|
+
@ncover.run
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
|
101
|
+
@ncover.system_command.should include("//or FullCoverageReport:Html:\"#{@fullcoverage_output_folder}\"")
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should tell ncover.reporting to produce a summary html report in the specified folder" do
|
105
|
+
@ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
|
106
|
+
end
|
108
107
|
end
|
109
108
|
|
110
109
|
describe NCoverReport, "when running a report with a specified minimum symbol coverage lower than actual coverage" do
|
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
|
-
|
110
|
+
before :all do
|
111
|
+
NCoverReportTestData.clean_output_folder
|
112
|
+
|
113
|
+
@ncover = NCoverReport.new
|
114
|
+
@ncover.extend(SystemPatch)
|
115
|
+
@ncover.log_level = :verbose
|
116
|
+
|
117
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
118
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
119
|
+
|
120
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
121
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
122
|
+
@ncover.reports fullcoveragereport
|
123
|
+
|
124
|
+
symbolcoverage = NCover::SymbolCoverage.new
|
125
|
+
symbolcoverage.minimum = 10
|
126
|
+
@ncover.required_coverage symbolcoverage
|
127
|
+
|
128
|
+
@ncover.run
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should tell ncover.reporting to check for the specified minimum coverage" do
|
132
|
+
@ncover.system_command.should include("//mc SymbolCoverage:10:View")
|
133
|
+
end
|
134
|
+
|
135
|
+
it "should not fail the execution" do
|
136
|
+
@ncover.failed.should be_false
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should produce the report" do
|
140
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
141
|
+
end
|
143
142
|
end
|
144
143
|
|
145
144
|
describe NCoverReport, "when running a report with a specified minimum symbol coverage higher than actual coverage" do
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
145
|
+
before :all do
|
146
|
+
NCoverReportTestData.clean_output_folder
|
147
|
+
|
148
|
+
@ncover = NCoverReport.new
|
149
|
+
@ncover.extend(SystemPatch)
|
150
|
+
@ncover.log_level = :verbose
|
151
|
+
|
152
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
153
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
154
|
+
|
155
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
156
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
157
|
+
@ncover.reports fullcoveragereport
|
158
|
+
|
159
|
+
symbolcoverage = NCover::SymbolCoverage.new
|
160
|
+
symbolcoverage.minimum = 100
|
161
|
+
@ncover.required_coverage symbolcoverage
|
162
|
+
|
163
|
+
@ncover.run
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should tell ncover.reporting to check for the specified minimum coverage" do
|
167
|
+
@ncover.system_command.should include("//mc SymbolCoverage:10")
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should fail the execution" do
|
171
|
+
@ncover.failed.should be_true
|
172
|
+
end
|
173
|
+
|
174
|
+
it "should produce the report" do
|
175
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
176
|
+
end
|
178
177
|
end
|
179
178
|
|
180
179
|
describe NCoverReport, "when specifying the coverage item type to check" do
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
180
|
+
before :all do
|
181
|
+
NCoverReportTestData.clean_output_folder
|
182
|
+
|
183
|
+
@ncover = NCoverReport.new
|
184
|
+
@ncover.extend(SystemPatch)
|
185
|
+
@ncover.log_level = :verbose
|
186
|
+
|
187
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
188
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
189
|
+
|
190
|
+
report = NCover::SummaryReport.new
|
191
|
+
report.output_path = NCoverReportTestData.summary_output_file
|
192
|
+
@ncover.reports report
|
193
|
+
|
194
|
+
symbolcoverage = NCover::SymbolCoverage.new
|
195
|
+
symbolcoverage.minimum = 10
|
196
|
+
symbolcoverage.item_type = :Class
|
197
|
+
@ncover.required_coverage symbolcoverage
|
198
|
+
|
199
|
+
@ncover.run
|
200
|
+
end
|
201
|
+
|
202
|
+
it "should tell ncover.reporting to check for the specified item type" do
|
203
|
+
@ncover.system_command.should include("//mc SymbolCoverage:10:Class")
|
204
|
+
end
|
205
|
+
|
206
|
+
it "should produce the report" do
|
207
|
+
File.exist?(NCoverReportTestData.summary_output_file).should be_true
|
208
|
+
end
|
210
209
|
end
|
211
210
|
|
212
211
|
describe NCoverReport, "when checking more than one type of coverage and all fail" do
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
212
|
+
before :all do
|
213
|
+
NCoverReportTestData.clean_output_folder
|
214
|
+
|
215
|
+
@ncover = NCoverReport.new
|
216
|
+
@ncover.extend(SystemPatch)
|
217
|
+
@ncover.log_level = :verbose
|
218
|
+
|
219
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
220
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
221
|
+
|
222
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
223
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
224
|
+
@ncover.reports fullcoveragereport
|
225
|
+
|
226
|
+
@ncover.required_coverage(
|
227
|
+
NCover::SymbolCoverage.new(:minimum => 100, :item_type => :View),
|
228
|
+
NCover::BranchCoverage.new(:minimum => 10, :item_type => :Class),
|
229
|
+
NCover::MethodCoverage.new(:minimum => 100, :item_type => :Class)
|
230
|
+
)
|
231
|
+
|
232
|
+
@ncover.run
|
233
|
+
end
|
234
|
+
|
235
|
+
it "should tell ncover.reporting to check for the symbol coverage" do
|
236
|
+
@ncover.system_command.should include("//mc SymbolCoverage:100:View")
|
237
|
+
end
|
238
|
+
|
239
|
+
it "should tell ncover.reporting to check for the branch coverage" do
|
240
|
+
@ncover.system_command.should include("//mc BranchCoverage:10:Class")
|
241
|
+
end
|
242
|
+
|
243
|
+
it "should tell ncover.reporting to check for the branch coverage" do
|
244
|
+
@ncover.system_command.should include("//mc MethodCoverage:100:Class")
|
245
|
+
end
|
246
|
+
|
247
|
+
it "should produce the report" do
|
248
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
249
|
+
end
|
250
|
+
|
251
|
+
it "should fail the execution" do
|
252
|
+
@ncover.failed.should be_true
|
253
|
+
end
|
253
254
|
end
|
254
255
|
|
255
256
|
describe NCoverReport, "when checking more than one type of coverage and all pass" do
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
257
|
+
before :all do
|
258
|
+
NCoverReportTestData.clean_output_folder
|
259
|
+
|
260
|
+
@ncover = NCoverReport.new
|
261
|
+
@ncover.extend(SystemPatch)
|
262
|
+
@ncover.log_level = :verbose
|
263
|
+
|
264
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
265
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
266
|
+
|
267
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
268
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
269
|
+
@ncover.reports fullcoveragereport
|
270
|
+
|
271
|
+
@ncover.required_coverage(
|
272
|
+
NCover::SymbolCoverage.new(:minimum => 0, :item_type => :View),
|
273
|
+
NCover::BranchCoverage.new(:minimum => 0, :item_type => :Class),
|
274
|
+
NCover::MethodCoverage.new(:minimum => 0, :item_type => :Class)
|
275
|
+
)
|
276
|
+
|
277
|
+
@ncover.run
|
278
|
+
end
|
279
|
+
|
280
|
+
it "should tell ncover.reporting to check for the symbol coverage" do
|
281
|
+
@ncover.system_command.should include("//mc SymbolCoverage:0:View")
|
282
|
+
end
|
283
|
+
|
284
|
+
it "should tell ncover.reporting to check for the branch coverage" do
|
285
|
+
@ncover.system_command.should include("//mc BranchCoverage:0:Class")
|
286
|
+
end
|
287
|
+
|
288
|
+
it "should tell ncover.reporting to check for the method coverage" do
|
289
|
+
@ncover.system_command.should include("//mc MethodCoverage:0:Class")
|
290
|
+
end
|
291
|
+
|
292
|
+
it "should produce the report" do
|
293
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
294
|
+
end
|
295
|
+
|
296
|
+
it "should not fail the execution" do
|
297
|
+
@ncover.failed.should be_false
|
298
|
+
end
|
296
299
|
end
|
297
300
|
|
298
301
|
describe NCoverReport, "when checking more than one type of coverage and one fails" do
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
302
|
+
before :all do
|
303
|
+
NCoverReportTestData.clean_output_folder
|
304
|
+
|
305
|
+
@ncover = NCoverReport.new
|
306
|
+
@ncover.extend(SystemPatch)
|
307
|
+
@ncover.log_level = :verbose
|
308
|
+
|
309
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
310
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
311
|
+
|
312
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
313
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
314
|
+
@ncover.reports fullcoveragereport
|
315
|
+
|
316
|
+
@ncover.required_coverage(
|
317
|
+
NCover::SymbolCoverage.new(:minimum => 100, :item_type => :View),
|
318
|
+
NCover::BranchCoverage.new(:minimum => 0, :item_type => :Class)
|
319
|
+
)
|
320
|
+
|
321
|
+
@ncover.run
|
322
|
+
end
|
323
|
+
|
324
|
+
it "should tell ncover.reporting to check for the symbol coverage" do
|
325
|
+
@ncover.system_command.should include("//mc SymbolCoverage:100:View")
|
326
|
+
end
|
327
|
+
|
328
|
+
it "should tell ncover.reporting to check for the branch coverage" do
|
329
|
+
@ncover.system_command.should include("//mc BranchCoverage:0:Class")
|
330
|
+
end
|
331
|
+
|
332
|
+
it "should produce the report" do
|
333
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
334
|
+
end
|
335
|
+
|
336
|
+
it "should fail the execution" do
|
337
|
+
@ncover.failed.should be_true
|
338
|
+
end
|
334
339
|
end
|
335
340
|
|
336
341
|
describe NCoverReport, "when running a report with a cyclomatic complexity higher than allowed" do
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
342
|
+
before :all do
|
343
|
+
NCoverReportTestData.clean_output_folder
|
344
|
+
|
345
|
+
@ncover = NCoverReport.new
|
346
|
+
@ncover.extend(SystemPatch)
|
347
|
+
@ncover.log_level = :verbose
|
348
|
+
|
349
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
350
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
351
|
+
|
352
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
353
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
354
|
+
@ncover.reports fullcoveragereport
|
355
|
+
|
356
|
+
coverage = NCover::CyclomaticComplexity.new(:maximum => 1, :item_type => :Class)
|
357
|
+
@ncover.required_coverage coverage
|
358
|
+
|
359
|
+
@ncover.run
|
360
|
+
end
|
361
|
+
|
362
|
+
it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
|
363
|
+
@ncover.system_command.should include("//mc CyclomaticComplexity:1:Class")
|
364
|
+
end
|
365
|
+
|
366
|
+
it "should fail the execution" do
|
367
|
+
@ncover.failed.should be_true
|
368
|
+
end
|
369
|
+
|
370
|
+
it "should produce the report" do
|
371
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
372
|
+
end
|
368
373
|
end
|
369
374
|
|
370
375
|
describe NCoverReport, "when running a report with a cyclomatic complexity under the limit" do
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
376
|
+
before :all do
|
377
|
+
NCoverReportTestData.clean_output_folder
|
378
|
+
|
379
|
+
@ncover = NCoverReport.new
|
380
|
+
@ncover.extend(SystemPatch)
|
381
|
+
@ncover.log_level = :verbose
|
382
|
+
|
383
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
384
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
385
|
+
|
386
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
387
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
388
|
+
@ncover.reports fullcoveragereport
|
389
|
+
|
390
|
+
coverage = NCover::CyclomaticComplexity.new(:maximum => 1000)
|
391
|
+
@ncover.required_coverage coverage
|
392
|
+
|
393
|
+
@ncover.run
|
394
|
+
end
|
395
|
+
|
396
|
+
it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
|
397
|
+
@ncover.system_command.should include("//mc CyclomaticComplexity:1000:View")
|
398
|
+
end
|
399
|
+
|
400
|
+
it "should not fail the execution" do
|
401
|
+
@ncover.failed.should be_false
|
402
|
+
end
|
403
|
+
|
404
|
+
it "should produce the report" do
|
405
|
+
File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
|
406
|
+
end
|
402
407
|
end
|
403
408
|
|
404
409
|
describe NCoverReport, "when filtering on Assembly coverage data" do
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
410
|
+
before :all do
|
411
|
+
NCoverReportTestData.clean_output_folder
|
412
|
+
|
413
|
+
@ncover = NCoverReport.new
|
414
|
+
@ncover.extend(SystemPatch)
|
415
|
+
@ncover.log_level = :verbose
|
416
|
+
|
417
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
418
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
419
|
+
|
420
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
421
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
422
|
+
@ncover.reports fullcoveragereport
|
423
|
+
@ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
|
424
|
+
|
425
|
+
@ncover.filters(
|
426
|
+
NCover::AssemblyFilter.new(:filter_type => :exclude, :filter => ["nunit.*"]),
|
427
|
+
NCover::AssemblyFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
|
428
|
+
)
|
429
|
+
|
430
|
+
@ncover.run
|
431
|
+
end
|
432
|
+
|
433
|
+
it "should exclude the specified assemblies data" do
|
434
|
+
@ncover.system_command.should include("//cf \"nunit.*\":Assembly:false:false")
|
435
|
+
end
|
436
|
+
|
437
|
+
it "should include the specified assemblies data" do
|
438
|
+
@ncover.system_command.should include("//cf \"TestSolution.*\":Assembly:false:true")
|
439
|
+
end
|
440
|
+
|
441
|
+
it "should not fail" do
|
442
|
+
@ncover.failed.should be_false
|
443
|
+
end
|
437
444
|
end
|
438
445
|
|
439
446
|
describe NCoverReport, "when filtering on Namespace coverage data" do
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
447
|
+
before :all do
|
448
|
+
NCoverReportTestData.clean_output_folder
|
449
|
+
|
450
|
+
@ncover = NCoverReport.new
|
451
|
+
@ncover.extend(SystemPatch)
|
452
|
+
@ncover.log_level = :verbose
|
453
|
+
|
454
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
455
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
456
|
+
|
457
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
458
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
459
|
+
@ncover.reports fullcoveragereport
|
460
|
+
@ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
|
461
|
+
|
462
|
+
@ncover.filters(
|
463
|
+
NCover::NamespaceFilter.new(:filter_type => :exclude, :filter => ["nunit.*"]),
|
464
|
+
NCover::NamespaceFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
|
465
|
+
)
|
466
|
+
|
467
|
+
@ncover.run
|
468
|
+
end
|
469
|
+
|
470
|
+
it "should exclude the specified data" do
|
471
|
+
@ncover.system_command.should include("//cf \"nunit.*\":Namespace:false:false")
|
472
|
+
end
|
473
|
+
|
474
|
+
it "should include the specified data" do
|
475
|
+
@ncover.system_command.should include("//cf \"TestSolution.*\":Namespace:false:true")
|
476
|
+
end
|
477
|
+
|
478
|
+
it "should not fail" do
|
479
|
+
@ncover.failed.should be_false
|
480
|
+
end
|
472
481
|
end
|
473
482
|
|
474
483
|
describe NCoverReport, "when filtering on Class coverage data" do
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
484
|
+
before :all do
|
485
|
+
NCoverReportTestData.clean_output_folder
|
486
|
+
|
487
|
+
@ncover = NCoverReport.new
|
488
|
+
@ncover.extend(SystemPatch)
|
489
|
+
@ncover.log_level = :verbose
|
490
|
+
|
491
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
492
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
493
|
+
|
494
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
495
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
496
|
+
@ncover.reports fullcoveragereport
|
497
|
+
@ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
|
498
|
+
|
499
|
+
@ncover.filters(
|
500
|
+
NCover::ClassFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
|
501
|
+
NCover::ClassFilter.new(:filter_type => :include, :filter => ["Bar"])
|
502
|
+
)
|
503
|
+
|
504
|
+
@ncover.run
|
505
|
+
end
|
506
|
+
|
507
|
+
it "should exclude the specified data" do
|
508
|
+
@ncover.system_command.should include("//cf \"Foo\":Class:false:false")
|
509
|
+
end
|
510
|
+
|
511
|
+
it "should include the specified data" do
|
512
|
+
@ncover.system_command.should include("//cf \"Bar\":Class:false:true")
|
513
|
+
end
|
514
|
+
|
515
|
+
it "should not fail" do
|
516
|
+
@ncover.failed.should be_false
|
517
|
+
end
|
507
518
|
end
|
508
519
|
|
509
520
|
describe NCoverReport, "when filtering on Method coverage data" do
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
521
|
+
before :all do
|
522
|
+
NCoverReportTestData.clean_output_folder
|
523
|
+
|
524
|
+
@ncover = NCoverReport.new
|
525
|
+
@ncover.extend(SystemPatch)
|
526
|
+
@ncover.log_level = :verbose
|
527
|
+
|
528
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
529
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
530
|
+
|
531
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
532
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
533
|
+
@ncover.reports fullcoveragereport
|
534
|
+
@ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
|
535
|
+
|
536
|
+
@ncover.filters(
|
537
|
+
NCover::MethodFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
|
538
|
+
NCover::MethodFilter.new(:filter_type => :include, :filter => ["Bar"])
|
539
|
+
)
|
540
|
+
|
541
|
+
@ncover.run
|
542
|
+
end
|
543
|
+
|
544
|
+
it "should exclude the specified data" do
|
545
|
+
@ncover.system_command.should include("//cf \"Foo\":Method:false:false")
|
546
|
+
end
|
547
|
+
|
548
|
+
it "should include the specified data" do
|
549
|
+
@ncover.system_command.should include("//cf \"Bar\":Method:false:true")
|
550
|
+
end
|
551
|
+
|
552
|
+
it "should not fail" do
|
553
|
+
@ncover.failed.should be_false
|
554
|
+
end
|
542
555
|
end
|
543
556
|
|
544
557
|
describe NCoverReport, "when filtering on Document coverage data" do
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
558
|
+
before :all do
|
559
|
+
NCoverReportTestData.clean_output_folder
|
560
|
+
|
561
|
+
@ncover = NCoverReport.new
|
562
|
+
@ncover.extend(SystemPatch)
|
563
|
+
@ncover.log_level = :verbose
|
564
|
+
|
565
|
+
@ncover.path_to_command = NCoverReportTestData.path_to_command
|
566
|
+
@ncover.coverage_files NCoverReportTestData.coverage_file
|
567
|
+
|
568
|
+
fullcoveragereport = NCover::FullCoverageReport.new
|
569
|
+
fullcoveragereport.output_path = NCoverReportTestData.output_folder
|
570
|
+
@ncover.reports fullcoveragereport
|
571
|
+
@ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
|
572
|
+
|
573
|
+
@ncover.filters(
|
574
|
+
NCover::DocumentFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
|
575
|
+
NCover::DocumentFilter.new(:filter_type => :include, :filter => ["Bar"])
|
576
|
+
)
|
577
|
+
|
578
|
+
@ncover.run
|
579
|
+
end
|
580
|
+
|
581
|
+
it "should exclude the specified data" do
|
582
|
+
@ncover.system_command.should include("//cf \"Foo\":Document:false:false")
|
583
|
+
end
|
584
|
+
|
585
|
+
it "should include the specified data" do
|
586
|
+
@ncover.system_command.should include("//cf \"Bar\":Document:false:true")
|
587
|
+
end
|
588
|
+
|
589
|
+
it "should not fail" do
|
590
|
+
@ncover.failed.should be_false
|
591
|
+
end
|
577
592
|
end
|