albacore 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/spec/nant_spec.rb
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
2
|
+
require 'albacore/nant'
|
3
|
+
require 'nanttestdata'
|
4
|
+
|
5
|
+
shared_examples_for "prepping nant" do
|
6
|
+
before :all do
|
7
|
+
@testdata = NAntTestData.new
|
8
|
+
@nant = @testdata.nant
|
9
|
+
@strio = StringIO.new
|
10
|
+
@nant.log_device = @strio
|
11
|
+
end
|
12
|
+
|
13
|
+
after :all do
|
14
|
+
@testdata.clean_output
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe NAnt, "when a nant path is not specified" do
|
19
|
+
it_should_behave_like "prepping nant"
|
20
|
+
|
21
|
+
before :all do
|
22
|
+
@log_data = @strio.string
|
23
|
+
@nant.run
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should fail" do
|
27
|
+
@nant.failed.should == true
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should log the missing command path" do
|
31
|
+
@log_data.should include("Command not found: ")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe NAnt, "when running a nant build file" do
|
36
|
+
it_should_behave_like "prepping nant"
|
37
|
+
|
38
|
+
before :all do
|
39
|
+
@nant.path_to_command = @testdata.nant_path
|
40
|
+
@nant.build_file = @testdata.build_file_path
|
41
|
+
@nant.run
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should execute the default task" do
|
45
|
+
File.exists?("#{@testdata.output_path}/buildfile.txt").should be true
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe NAnt, "when running specific targets" do
|
50
|
+
it_should_behave_like "prepping nant"
|
51
|
+
|
52
|
+
before :all do
|
53
|
+
@nant.path_to_command = @testdata.nant_path
|
54
|
+
@nant.build_file = @testdata.build_file_path
|
55
|
+
@nant.targets :build, :other
|
56
|
+
@nant.run
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should execute the first task" do
|
60
|
+
File.exists?("#{@testdata.output_path}/buildfile.txt").should be true
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should execute the second task" do
|
64
|
+
File.exists?("#{@testdata.output_path}/otherfile.txt").should be true
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe NAnt, "when specifying multiple configuration properties" do
|
69
|
+
|
70
|
+
before :all do
|
71
|
+
@testdata = NAntTestData.new(:fast,"1.2.3")
|
72
|
+
@nant = @testdata.nant
|
73
|
+
@strio = StringIO.new
|
74
|
+
@nant.log_device = @strio
|
75
|
+
@nant.path_to_command = @testdata.nant_path
|
76
|
+
@nant.build_file = @testdata.build_file_path
|
77
|
+
|
78
|
+
@nant.properties :version => "1.2.3", "build.mode" => :fast, :debug => false
|
79
|
+
@nant.run
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should spedify the first property" do
|
83
|
+
@nant.system_command.should include("-D:version=1.2.3")
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should spedify the second property" do
|
87
|
+
@nant.system_command.should include("-D:build.mode=fast")
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should spedify the last property" do
|
91
|
+
@nant.system_command.should include("-D:debug=false")
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should create the output file" do
|
95
|
+
File.exists?("#{@testdata.output_path}/buildfile.txt").should be true
|
96
|
+
end
|
97
|
+
|
98
|
+
after :all do
|
99
|
+
@testdata.clean_output
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
2
|
+
require 'albacore/nant'
|
3
|
+
require 'rake/nanttask'
|
4
|
+
require 'tasklib_patch'
|
5
|
+
|
6
|
+
describe Albacore::NAntTask, "when running" do
|
7
|
+
before :all do
|
8
|
+
task = Albacore::NAntTask.new(:nant) do |t|
|
9
|
+
@yielded_object = t
|
10
|
+
end
|
11
|
+
task.extend(TasklibPatch)
|
12
|
+
Rake::Task[:nant].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should yield the nant api" do
|
16
|
+
@yielded_object.kind_of?(NAnt).should == true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe Albacore::NAntTask, "when execution fails" do
|
21
|
+
before :all do
|
22
|
+
@task = Albacore::NAntTask.new(:nant_failingtask)
|
23
|
+
@task.extend(TasklibPatch)
|
24
|
+
@task.fail
|
25
|
+
Rake::Task[:nant_failingtask].invoke
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should fail the rake task" do
|
29
|
+
@task.task_failed.should == true
|
30
|
+
end
|
31
|
+
end
|
data/spec/ncoverconsole_spec.rb
CHANGED
@@ -2,246 +2,278 @@ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
|
2
2
|
require 'albacore/ncoverconsole'
|
3
3
|
require 'albacore/nunittestrunner'
|
4
4
|
require 'albacore/mspectestrunner'
|
5
|
+
require 'ncoverconsoletestdata'
|
5
6
|
|
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
|
-
nunit = NUnitTestRunner.new(@@nunitpath)
|
32
|
-
nunit.assemblies << @@test_assembly
|
33
|
-
nunit.options << '/noshadow'
|
34
|
-
|
35
|
-
@ncc.testrunner = nunit
|
36
|
-
@ncc.run
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should provide coverage for the specified assemblies" do
|
40
|
-
@ncc.system_command.should include("//assemblies \"TestSolution\"")
|
41
|
-
end
|
7
|
+
describe NCoverConsole, "when specifying assemblies to cover" do
|
8
|
+
before :all do
|
9
|
+
@testdata = NCoverConsoleTestData.new
|
10
|
+
File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
|
11
|
+
|
12
|
+
@ncc = NCoverConsole.new()
|
13
|
+
|
14
|
+
@ncc.extend(SystemPatch)
|
15
|
+
@ncc.log_level = :verbose
|
16
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
17
|
+
@ncc.output :xml => @testdata.xml_coverage_output
|
18
|
+
@ncc.working_directory = @testdata.working_directory
|
19
|
+
@ncc.cover_assemblies "TestSolution"
|
20
|
+
|
21
|
+
nunit = NUnitTestRunner.new(@testdata.nunitpath)
|
22
|
+
nunit.assemblies @testdata.test_assembly
|
23
|
+
nunit.options '/noshadow'
|
24
|
+
|
25
|
+
@ncc.testrunner = nunit
|
26
|
+
@ncc.run
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should provide coverage for the specified assemblies" do
|
30
|
+
@ncc.system_command.should include("//assemblies \"TestSolution\"")
|
31
|
+
end
|
42
32
|
end
|
43
33
|
|
44
34
|
describe NCoverConsole, "when specifying assemblies to ignore" do
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
35
|
+
before :all do
|
36
|
+
@testdata = NCoverConsoleTestData.new
|
37
|
+
File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
|
38
|
+
|
39
|
+
@ncc = NCoverConsole.new()
|
40
|
+
|
41
|
+
@ncc.extend(SystemPatch)
|
42
|
+
@ncc.log_level = :verbose
|
43
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
44
|
+
@ncc.output :xml => @testdata.xml_coverage_output
|
45
|
+
@ncc.working_directory = @testdata.working_directory
|
46
|
+
@ncc.ignore_assemblies "TestSolution.*"
|
47
|
+
|
48
|
+
nunit = NUnitTestRunner.new(@testdata.nunitpath)
|
49
|
+
nunit.assemblies @testdata.test_assembly
|
50
|
+
nunit.options '/noshadow'
|
51
|
+
|
52
|
+
@ncc.testrunner = nunit
|
53
|
+
@ncc.run
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should provide coverage for the specified assemblies" do
|
57
|
+
@ncc.system_command.should include("//exclude-assemblies \"TestSolution.*\"")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe NCoverConsole, "when running with the defaults" do
|
62
|
+
before :all do
|
63
|
+
@testdata = NCoverConsoleTestData.new
|
64
|
+
@ncc = NCoverConsole.new
|
65
|
+
|
66
|
+
@ncc.extend(SystemPatch)
|
67
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
68
|
+
@ncc.testrunner = NUnitTestRunner.new
|
69
|
+
|
70
|
+
@ncc.run
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should include the register flag in the command" do
|
74
|
+
@ncc.system_command.should include "//reg"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe NCoverConsole, "when opting out of registering the ncover dll" do
|
79
|
+
before :all do
|
80
|
+
@testdata = NCoverConsoleTestData.new
|
81
|
+
@ncc = NCoverConsole.new
|
82
|
+
|
83
|
+
@ncc.extend(SystemPatch)
|
84
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
85
|
+
@ncc.no_registration
|
86
|
+
@ncc.testrunner = NUnitTestRunner.new
|
87
|
+
|
88
|
+
@ncc.run
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should not include the register flag in the command" do
|
92
|
+
@ncc.system_command.should_not include "//reg"
|
93
|
+
end
|
68
94
|
end
|
69
95
|
|
70
96
|
describe NCoverConsole, "when specifying the types of coverage to analyze" do
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
97
|
+
before :all do
|
98
|
+
@testdata = NCoverConsoleTestData.new
|
99
|
+
File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
|
100
|
+
|
101
|
+
@ncc = NCoverConsole.new()
|
102
|
+
|
103
|
+
@ncc.extend(SystemPatch)
|
104
|
+
@ncc.log_level = :verbose
|
105
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
106
|
+
@ncc.output :xml => @testdata.xml_coverage_output
|
107
|
+
@ncc.working_directory = @testdata.working_directory
|
108
|
+
@ncc.coverage :Symbol, :Branch, :MethodVisits, :CyclomaticComplexity
|
109
|
+
|
110
|
+
nunit = NUnitTestRunner.new(@testdata.nunitpath)
|
111
|
+
nunit.assemblies @testdata.test_assembly
|
112
|
+
nunit.options '/noshadow'
|
113
|
+
|
114
|
+
@ncc.testrunner = nunit
|
115
|
+
@ncc.run
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should only run coverage for those metrics" do
|
119
|
+
@ncc.system_command.should include("//coverage-type \"Symbol, Branch, MethodVisits, CyclomaticComplexity\"")
|
120
|
+
end
|
94
121
|
end
|
95
122
|
|
96
123
|
describe NCoverConsole, "when analyzing a test suite with failing tests" do
|
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
|
-
|
124
|
+
before :all do
|
125
|
+
@testdata = NCoverConsoleTestData.new
|
126
|
+
File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
|
127
|
+
|
128
|
+
ncc = NCoverConsole.new()
|
129
|
+
strio = StringIO.new
|
130
|
+
ncc.log_device = strio
|
131
|
+
|
132
|
+
ncc.extend(SystemPatch)
|
133
|
+
ncc.log_level = :verbose
|
134
|
+
ncc.path_to_command = @testdata.ncoverpath
|
135
|
+
ncc.output :xml => @testdata.xml_coverage_output
|
136
|
+
ncc.working_directory = @testdata.working_directory
|
137
|
+
|
138
|
+
nunit = NUnitTestRunner.new(@testdata.nunitpath)
|
139
|
+
nunit.assemblies @testdata.failing_test_assembly
|
140
|
+
nunit.options '/noshadow'
|
141
|
+
|
142
|
+
ncc.testrunner = nunit
|
143
|
+
|
144
|
+
ncc.run
|
145
|
+
@failed = ncc.failed
|
146
|
+
@log_data = strio.string
|
147
|
+
end
|
148
|
+
|
149
|
+
it "should return a failure code" do
|
150
|
+
@failed.should == true
|
151
|
+
end
|
152
|
+
|
153
|
+
it "should log a failure message" do
|
154
|
+
@log_data.should include("Code Coverage Analysis Failed. See Build Log For Detail.")
|
155
|
+
end
|
128
156
|
end
|
129
157
|
|
130
158
|
describe NCoverConsole, "when running without a testrunner" do
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
159
|
+
before :all do
|
160
|
+
@testdata = NCoverConsoleTestData.new
|
161
|
+
ncc = NCoverConsole.new()
|
162
|
+
strio = StringIO.new
|
163
|
+
ncc.log_device = strio
|
164
|
+
|
165
|
+
@result = ncc.run
|
166
|
+
@log_data = strio.string
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should log a message saying the test runner is required" do
|
170
|
+
@log_data.should include("testrunner cannot be nil.")
|
171
|
+
end
|
172
|
+
|
173
|
+
it "should return a failure code" do
|
174
|
+
@result.should == false
|
175
|
+
end
|
147
176
|
end
|
148
177
|
|
149
178
|
describe NCoverConsole, "when producing an xml coverage report with nunit" do
|
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
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
179
|
+
before :all do
|
180
|
+
@testdata = NCoverConsoleTestData.new
|
181
|
+
File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
|
182
|
+
|
183
|
+
@ncc = NCoverConsole.new()
|
184
|
+
|
185
|
+
@ncc.extend(SystemPatch)
|
186
|
+
@ncc.log_level = :verbose
|
187
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
188
|
+
@ncc.output :xml => @testdata.xml_coverage_output
|
189
|
+
@ncc.working_directory = @testdata.working_directory
|
190
|
+
|
191
|
+
nunit = NUnitTestRunner.new(@testdata.nunitpath)
|
192
|
+
nunit.assemblies @testdata.test_assembly
|
193
|
+
nunit.options '/noshadow'
|
194
|
+
|
195
|
+
@ncc.testrunner = nunit
|
196
|
+
@ncc.run
|
197
|
+
end
|
198
|
+
|
199
|
+
it "should execute ncover.console from the specified path" do
|
200
|
+
@ncc.system_command.should include(@testdata.ncoverpath)
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should execute with the specified working directory" do
|
204
|
+
@ncc.system_command.should include(@testdata.working_directory)
|
205
|
+
end
|
206
|
+
|
207
|
+
it "should execute the test runner from the specified path" do
|
208
|
+
@ncc.system_command.should include(@testdata.nunitpath)
|
209
|
+
end
|
210
|
+
|
211
|
+
it "should pass the specified arguments to the test runner" do
|
212
|
+
@ncc.system_command.should include("TestSolution.Tests.dll /noshadow")
|
213
|
+
end
|
214
|
+
|
215
|
+
it "should write the coverage data to the specified file" do
|
216
|
+
File.exist?(@testdata.xml_coverage_output).should == true
|
217
|
+
end
|
188
218
|
end
|
189
219
|
|
190
220
|
describe NCoverConsole, "when specifying an html report and an xml coverage report with nunit" do
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
221
|
+
before :all do
|
222
|
+
@testdata = NCoverConsoleTestData.new
|
223
|
+
File.delete(@testdata.xml_coverage_output) if File.exist?(@testdata.xml_coverage_output)
|
224
|
+
File.delete(@testdata.html_coverage_output) if File.exist?(@testdata.html_coverage_output)
|
225
|
+
|
226
|
+
ncc = NCoverConsole.new()
|
227
|
+
|
228
|
+
ncc.extend(SystemPatch)
|
229
|
+
ncc.log_level = :verbose
|
230
|
+
ncc.path_to_command = @testdata.ncoverpath
|
231
|
+
ncc.output :xml => @testdata.xml_coverage_output, :html => @testdata.html_coverage_output
|
232
|
+
ncc.working_directory = @testdata.working_directory
|
233
|
+
|
234
|
+
nunit = NUnitTestRunner.new(@testdata.nunitpath)
|
235
|
+
nunit.assemblies @testdata.test_assembly
|
236
|
+
nunit.options '/noshadow'
|
237
|
+
|
238
|
+
ncc.testrunner = nunit
|
239
|
+
ncc.run
|
240
|
+
end
|
241
|
+
|
242
|
+
|
243
|
+
it "should produce the xml report" do
|
244
|
+
File.exist?(@testdata.xml_coverage_output).should == true
|
245
|
+
end
|
246
|
+
|
247
|
+
it "should produce the html report" do
|
248
|
+
File.exist?(@testdata.html_coverage_output).should == true
|
249
|
+
end
|
219
250
|
end
|
220
251
|
|
221
252
|
describe NCoverConsole, "when producing a report with machine.specifications" do
|
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
|
-
|
253
|
+
before :all do
|
254
|
+
@testdata = NCoverConsoleTestData.new
|
255
|
+
@ncc = NCoverConsole.new()
|
256
|
+
|
257
|
+
@ncc.extend(SystemPatch)
|
258
|
+
@ncc.log_level = :verbose
|
259
|
+
@ncc.path_to_command = @testdata.ncoverpath
|
260
|
+
@ncc.output :xml => @testdata.xml_coverage_output
|
261
|
+
@ncc.working_directory = @testdata.working_directory
|
262
|
+
|
263
|
+
mspec = MSpecTestRunner.new(@testdata.mspecpath)
|
264
|
+
mspec.assemblies @testdata.mspec_test_assembly
|
265
|
+
mspec.html_output = @testdata.mspec_html_output
|
266
|
+
|
267
|
+
@ncc.testrunner = mspec
|
268
|
+
@ncc.run
|
269
|
+
end
|
270
|
+
|
271
|
+
it "should not fail" do
|
272
|
+
@ncc.failed.should be_false
|
273
|
+
end
|
274
|
+
|
275
|
+
it "should produce the html report" do
|
276
|
+
File.exist?(@testdata.mspec_html_output.to_s).should be_true
|
277
|
+
end
|
278
|
+
|
279
|
+
end
|