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
@@ -1,64 +1,71 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
class NCoverConsole
|
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
|
-
|
4
|
+
extend AttrMethods
|
5
|
+
include RunCommand
|
6
|
+
include YAMLConfig
|
7
|
+
|
8
|
+
attr_accessor :testrunner, :working_directory
|
9
|
+
attr_array :cover_assemblies, :ignore_assemblies, :coverage
|
10
|
+
attr_hash :output
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@register_dll = true
|
14
|
+
@output = {}
|
15
|
+
@cover_assemblies = []
|
16
|
+
@ignore_assemblies = []
|
17
|
+
@coverage = []
|
18
|
+
super()
|
19
|
+
end
|
20
|
+
|
21
|
+
def working_directory=(working_dir)
|
22
|
+
@working_directory = "//working-directory " + working_dir
|
23
|
+
end
|
24
|
+
|
25
|
+
def no_registration
|
26
|
+
@register_dll = false
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
check_testrunner
|
31
|
+
return false if @failed
|
32
|
+
|
33
|
+
command_parameters = []
|
34
|
+
command_parameters << "//reg" if @register_dll
|
35
|
+
command_parameters << build_output_options(@output) unless @output.nil?
|
36
|
+
command_parameters << @working_directory unless @working_directory.nil?
|
37
|
+
command_parameters << build_assembly_list("assemblies", @cover_assemblies) unless @cover_assemblies.empty?
|
38
|
+
command_parameters << build_assembly_list("exclude-assemblies", @ignore_assemblies) unless @ignore_assemblies.empty?
|
39
|
+
command_parameters << build_coverage_list(@coverage) unless @coverage.empty?
|
40
|
+
command_parameters << @testrunner.get_command_line
|
41
|
+
|
42
|
+
result = run_command "NCover.Console", command_parameters.join(" ")
|
43
|
+
|
44
|
+
failure_msg = 'Code Coverage Analysis Failed. See Build Log For Detail.'
|
45
|
+
fail_with_message failure_msg if !result
|
46
|
+
end
|
47
|
+
|
48
|
+
def check_testrunner
|
49
|
+
return if (!@testrunner.nil?)
|
50
|
+
msg = 'testrunner cannot be nil.'
|
51
|
+
@logger.info msg
|
52
|
+
fail
|
53
|
+
end
|
54
|
+
|
55
|
+
def build_output_options(output)
|
56
|
+
options = []
|
57
|
+
output.each do |key, value|
|
58
|
+
options << "//#{key} #{value}"
|
59
|
+
end
|
60
|
+
options.join(" ")
|
61
|
+
end
|
62
|
+
|
63
|
+
def build_assembly_list(param_name, list)
|
64
|
+
assembly_list = list.map{|asm| "\"#{asm}\""}.join(';')
|
65
|
+
"//#{param_name} #{assembly_list}"
|
66
|
+
end
|
67
|
+
|
68
|
+
def build_coverage_list(coverage)
|
69
|
+
"//coverage-type \"#{coverage.join(', ')}\""
|
70
|
+
end
|
71
|
+
end
|
@@ -2,60 +2,61 @@ Dir.glob(File.join(File.expand_path(File.dirname(__FILE__)), 'ncoverreports/*.rb
|
|
2
2
|
require 'albacore/support/albacore_helper'
|
3
3
|
|
4
4
|
class NCoverReport
|
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
|
-
|
5
|
+
extend AttrMethods
|
6
|
+
include RunCommand
|
7
|
+
include YAMLConfig
|
8
|
+
|
9
|
+
attr_array :coverage_files, :reports, :required_coverage, :filters
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@coverage_files = []
|
13
|
+
@reports = []
|
14
|
+
@required_coverage = []
|
15
|
+
@filters = []
|
16
|
+
super()
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
check_command
|
21
|
+
return if @failed
|
22
|
+
|
23
|
+
command_parameters = []
|
24
|
+
command_parameters << build_coverage_files unless @coverage_files.empty?
|
25
|
+
command_parameters << build_reports unless @reports.empty?
|
26
|
+
command_parameters << build_required_coverage unless @required_coverage.empty?
|
27
|
+
command_parameters << build_filters unless @filters.empty?
|
28
|
+
|
29
|
+
result = run_command "NCover.Reporting", command_parameters.join(" ")
|
30
|
+
|
31
|
+
failure_msg = 'Code Coverage Reporting Failed. See Build Log For Detail.'
|
32
|
+
fail_with_message failure_msg if !result
|
33
|
+
end
|
34
|
+
|
35
|
+
def check_command
|
36
|
+
return if @path_to_command
|
37
|
+
fail_with_message 'NCoverReport.path_to_command cannot be nil.'
|
38
|
+
end
|
39
|
+
|
40
|
+
def build_filters
|
41
|
+
@filters.map{|f| "//cf #{f.get_filter_options}"}.join(" ")
|
42
|
+
end
|
43
|
+
|
44
|
+
def build_coverage_files
|
45
|
+
@coverage_files.map{|f| "\"#{f}\""}.join(" ")
|
46
|
+
end
|
47
|
+
|
48
|
+
def build_reports
|
49
|
+
@reports.map{|r|
|
50
|
+
report = "//or #{r.report_type}"
|
51
|
+
report << ":#{r.report_format}" unless r.report_format.nil?
|
52
|
+
report << ":\"#{r.output_path}\"" unless r.output_path.nil?
|
53
|
+
report
|
54
|
+
}.join(" ")
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
def build_required_coverage
|
58
|
+
@required_coverage.map{|c|
|
59
|
+
coverage = "//mc #{c.get_coverage_options}"
|
60
|
+
}.join(" ")
|
61
|
+
end
|
61
62
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'albacore/ncoverreports/reportfilterbase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
4
|
+
class AssemblyFilter < NCover::ReportFilterBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("Assembly", params)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'albacore/ncoverreports/codecoveragebase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
4
|
+
class BranchCoverage < NCover::CodeCoverageBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("BranchCoverage", params)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'albacore/ncoverreports/reportfilterbase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class ClassFilter < NCover::ReportFilterBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("Class", params)
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
25
|
-
|
4
|
+
class CodeCoverageBase
|
5
|
+
include YAMLConfig
|
6
|
+
|
7
|
+
attr_accessor :coverage_type, :minimum, :item_type
|
8
|
+
|
9
|
+
def initialize(coverage_type, params={})
|
10
|
+
@coverage_type = coverage_type
|
11
|
+
@minimum = 0
|
12
|
+
@item_type = :View
|
13
|
+
parse_config(params) unless params.nil?
|
14
|
+
super()
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_coverage_options
|
18
|
+
options = "#{@coverage_type}"
|
19
|
+
options << ":#{@minimum}" unless @minimum.nil?
|
20
|
+
options << ":#{@item_type}" unless @item_type.nil?
|
21
|
+
options
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
@@ -1,23 +1,23 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
4
|
+
class CyclomaticComplexity
|
5
|
+
include YAMLConfig
|
6
|
+
|
7
|
+
attr_accessor :maximum, :item_type
|
8
|
+
|
9
|
+
def initialize(params={})
|
10
|
+
@maximum = 100
|
11
|
+
@item_type = :View
|
12
|
+
parse_config(params) unless params.nil?
|
13
|
+
super()
|
14
|
+
end
|
15
|
+
|
16
|
+
def get_coverage_options
|
17
|
+
options = "CyclomaticComplexity"
|
18
|
+
options << ":#{maximum}" unless maximum.nil?
|
19
|
+
options << ":#{item_type}" unless item_type.nil?
|
20
|
+
options
|
21
|
+
end
|
22
|
+
end
|
23
23
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'albacore/ncoverreports/reportfilterbase'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class DocumentFilter < NCover::ReportFilterBase
|
5
|
+
def initialize(params={})
|
6
|
+
super("Document", params)
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,21 +1,21 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
2
|
|
3
3
|
module NCover
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
class FullCoverageReport
|
5
|
+
include YAMLConfig
|
6
|
+
|
7
|
+
attr_accessor :output_path
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
super()
|
11
|
+
end
|
12
|
+
|
13
|
+
def report_type
|
14
|
+
:FullCoverageReport
|
15
|
+
end
|
16
|
+
|
17
|
+
def report_format
|
18
|
+
:Html
|
19
|
+
end
|
20
|
+
end
|
21
21
|
end
|