albacore 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +4 -4
- data/.bundle/config +2 -2
- data/.rvmrc +1 -1
- data/Gemfile +12 -12
- data/README.markdown +92 -68
- data/VERSION +1 -1
- data/lib/albacore.rb +9 -9
- data/lib/albacore/albacoretask.rb +50 -50
- data/lib/albacore/aspnetcompiler.rb +58 -58
- data/lib/albacore/assemblyinfo.rb +140 -140
- data/lib/albacore/assemblyinfolanguages/cppcliengine.rb +17 -0
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +18 -18
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +18 -18
- data/lib/albacore/config/aspnetcompilerconfig.rb +29 -29
- data/lib/albacore/config/assemblyinfoconfig.rb +13 -13
- data/lib/albacore/config/config.rb +22 -22
- data/lib/albacore/config/cscconfig.rb +28 -28
- data/lib/albacore/config/docuconfig.rb +23 -23
- data/lib/albacore/config/execconfig.rb +15 -15
- data/lib/albacore/config/fluentmigratorrunnerconfig.rb +15 -15
- data/lib/albacore/config/msbuildconfig.rb +29 -29
- data/lib/albacore/config/mspectestrunnerconfig.rb +15 -15
- data/lib/albacore/config/mstesttestrunnerconfig.rb +15 -15
- data/lib/albacore/config/nantconfig.rb +15 -15
- data/lib/albacore/config/nchurnconfig.rb +15 -15
- data/lib/albacore/config/ncoverconsoleconfig.rb +15 -15
- data/lib/albacore/config/ncoverreportconfig.rb +15 -15
- data/lib/albacore/config/ndependconfig.rb +15 -15
- data/lib/albacore/config/netversion.rb +21 -21
- data/lib/albacore/config/nugetpackconfig.rb +3 -3
- data/lib/albacore/config/nugetpublishconfig.rb +19 -0
- data/lib/albacore/config/nugetpushconfig.rb +19 -0
- data/lib/albacore/config/nunittestrunnerconfig.rb +14 -14
- data/lib/albacore/config/specflowreportconfig.rb +24 -24
- data/lib/albacore/config/sqlcmdconfig.rb +15 -15
- data/lib/albacore/config/unzipconfig.rb +15 -15
- data/lib/albacore/config/vssgetconfig.rb +14 -0
- data/lib/albacore/config/xbuildconfig.rb +15 -15
- data/lib/albacore/config/xunittestrunnerconfig.rb +15 -15
- data/lib/albacore/config/zipdirectoryconfig.rb +15 -15
- data/lib/albacore/csc.rb +66 -62
- data/lib/albacore/docu.rb +41 -41
- data/lib/albacore/exec.rb +18 -18
- data/lib/albacore/fluentmigratorrunner.rb +51 -46
- data/lib/albacore/msbuild.rb +55 -55
- data/lib/albacore/mspectestrunner.rb +50 -50
- data/lib/albacore/mstesttestrunner.rb +43 -43
- data/lib/albacore/nant.rb +38 -38
- data/lib/albacore/nchurn.rb +74 -74
- data/lib/albacore/ncoverconsole.rb +68 -68
- data/lib/albacore/ncoverreport.rb +62 -62
- data/lib/albacore/ncoverreports/assemblyfilter.rb +9 -9
- data/lib/albacore/ncoverreports/branchcoverage.rb +9 -9
- data/lib/albacore/ncoverreports/classfilter.rb +9 -9
- data/lib/albacore/ncoverreports/codecoveragebase.rb +25 -25
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +23 -23
- data/lib/albacore/ncoverreports/documentfilter.rb +9 -9
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +13 -13
- data/lib/albacore/ncoverreports/methodcoverage.rb +9 -9
- data/lib/albacore/ncoverreports/methodfilter.rb +9 -9
- data/lib/albacore/ncoverreports/namespacefilter.rb +9 -9
- data/lib/albacore/ncoverreports/reportfilterbase.rb +26 -26
- data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
- data/lib/albacore/ncoverreports/symbolcoverage.rb +9 -9
- data/lib/albacore/ndepend.rb +33 -33
- data/lib/albacore/nugetpublish.rb +47 -0
- data/lib/albacore/nugetpush.rb +46 -0
- data/lib/albacore/nunittestrunner.rb +41 -41
- data/lib/albacore/nuspec.rb +133 -109
- data/lib/albacore/output.rb +99 -99
- data/lib/albacore/plink.rb +47 -47
- data/lib/albacore/specflowreport.rb +62 -62
- data/lib/albacore/sqlcmd.rb +80 -80
- data/lib/albacore/support/attrmethods.rb +33 -33
- data/lib/albacore/support/createtask.rb +50 -30
- data/lib/albacore/support/failure.rb +15 -15
- data/lib/albacore/support/logging.rb +38 -38
- data/lib/albacore/support/openstruct.rb +13 -13
- data/lib/albacore/support/runcommand.rb +45 -45
- data/lib/albacore/support/supportlinux.rb +23 -23
- data/lib/albacore/support/updateattributes.rb +13 -13
- data/lib/albacore/support/yamlconfig.rb +18 -18
- data/lib/albacore/unzip.rb +28 -28
- data/lib/albacore/vssget.rb +44 -0
- data/lib/albacore/xbuild.rb +54 -54
- data/lib/albacore/xunittestrunner.rb +52 -52
- data/lib/albacore/zipdirectory.rb +105 -105
- data/rakefile.rb +297 -297
- data/spec/albacoremodel_spec.rb +53 -53
- data/spec/assemblyinfo_spec.rb +541 -541
- data/spec/attrmethods_spec.rb +136 -136
- data/spec/config_spec.rb +34 -34
- data/spec/createtask_spec.rb +236 -236
- data/spec/csc_spec.rb +253 -253
- data/spec/docu_spec.rb +109 -109
- data/spec/exec_spec.rb +45 -45
- data/spec/fluentmigratorrunner_spec.rb +254 -185
- data/spec/msbuild_spec.rb +215 -215
- data/spec/mspec_spec.rb +28 -28
- data/spec/mstesttestrunner_spec.rb +142 -142
- data/spec/nant_spec.rb +110 -110
- data/spec/nchurn_spec.rb +75 -75
- data/spec/ncoverconsole_spec.rb +353 -353
- data/spec/ncoverreport_spec.rb +619 -619
- data/spec/ndepend_spec.rb +72 -72
- data/spec/nunittestrunner_spec.rb +122 -122
- data/spec/nuspec_spec.rb +78 -78
- data/spec/patches/docu_patch.rb +12 -12
- data/spec/patches/fail_patch.rb +8 -8
- data/spec/patches/system_patch.rb +20 -20
- data/spec/plink_spec.rb +62 -62
- data/spec/runcommand_spec.rb +94 -94
- data/spec/spec_helper.rb +17 -17
- data/spec/specflowreport_spec.rb +146 -146
- data/spec/sqlcmd_spec.rb +334 -334
- data/spec/support/assemblyinfotester.rb +51 -51
- data/spec/support/ironruby_validator.rb +26 -26
- data/spec/support/msbuildtestdata.rb +32 -32
- data/spec/support/nanttestdata.rb +33 -33
- data/spec/support/ncoverconsoletestdata.rb +19 -19
- data/spec/support/ncoverreporttestdata.rb +26 -26
- data/spec/support/nokogiri_validator.rb +15 -15
- data/spec/support/outputtestdata.rb +12 -12
- data/spec/support/ziptestdata.rb +12 -12
- data/spec/unzip_spec.rb +15 -15
- data/spec/xbuild_spec.rb +15 -15
- data/spec/xunit_spec.rb +168 -168
- data/spec/yamlconfig_spec.rb +49 -49
- data/spec/zip_spec.rb +104 -104
- data/watchrtesting.rb +8 -8
- metadata +15 -119
@@ -1,51 +1,51 @@
|
|
1
|
-
require 'albacore/assemblyinfo'
|
2
|
-
|
3
|
-
class AssemblyInfoTester < AssemblyInfo
|
4
|
-
|
5
|
-
attr_accessor :assemblyinfo_file
|
6
|
-
|
7
|
-
def initialize(lang_engine = nil)
|
8
|
-
@version = "0.0.0.1"
|
9
|
-
@title = "some assembly title"
|
10
|
-
@description = "some assembly description goes here."
|
11
|
-
@copyright = "some copyright info goes here"
|
12
|
-
@com_visible = false
|
13
|
-
@com_guid = "dbabb27c-a536-4b5b-91f1-2226b6e3655c"
|
14
|
-
@company_name = "some company name"
|
15
|
-
@product_name = "my product, yo."
|
16
|
-
@file_version = "1.0.0.0"
|
17
|
-
@trademark = "some trademark info goes here"
|
18
|
-
|
19
|
-
@input_file = nil
|
20
|
-
end
|
21
|
-
|
22
|
-
def setup_assemblyinfo_file
|
23
|
-
@lang_engine = CSharpEngine.new unless check_lang_engine
|
24
|
-
|
25
|
-
@assemblyinfo_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfo.test")
|
26
|
-
File.delete @assemblyinfo_file if File.exist? @assemblyinfo_file
|
27
|
-
end
|
28
|
-
|
29
|
-
def use_input_file
|
30
|
-
@input_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfoInput.test")
|
31
|
-
end
|
32
|
-
|
33
|
-
def build_and_read_assemblyinfo_file(assemblyinfo)
|
34
|
-
setup_assemblyinfo_file
|
35
|
-
|
36
|
-
assemblyinfo.input_file = @input_file unless @input_file.nil?
|
37
|
-
assemblyinfo.output_file = @assemblyinfo_file
|
38
|
-
assemblyinfo.execute
|
39
|
-
|
40
|
-
contents = ''
|
41
|
-
File.open(@assemblyinfo_file, "r") do |f|
|
42
|
-
contents = f.read
|
43
|
-
end
|
44
|
-
contents
|
45
|
-
end
|
46
|
-
|
47
|
-
def yaml_file
|
48
|
-
return File.join(File.dirname(__FILE__), "AssemblyInfo", "assemblyinfo.yml")
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
1
|
+
require 'albacore/assemblyinfo'
|
2
|
+
|
3
|
+
class AssemblyInfoTester < AssemblyInfo
|
4
|
+
|
5
|
+
attr_accessor :assemblyinfo_file
|
6
|
+
|
7
|
+
def initialize(lang_engine = nil)
|
8
|
+
@version = "0.0.0.1"
|
9
|
+
@title = "some assembly title"
|
10
|
+
@description = "some assembly description goes here."
|
11
|
+
@copyright = "some copyright info goes here"
|
12
|
+
@com_visible = false
|
13
|
+
@com_guid = "dbabb27c-a536-4b5b-91f1-2226b6e3655c"
|
14
|
+
@company_name = "some company name"
|
15
|
+
@product_name = "my product, yo."
|
16
|
+
@file_version = "1.0.0.0"
|
17
|
+
@trademark = "some trademark info goes here"
|
18
|
+
|
19
|
+
@input_file = nil
|
20
|
+
end
|
21
|
+
|
22
|
+
def setup_assemblyinfo_file
|
23
|
+
@lang_engine = CSharpEngine.new unless check_lang_engine
|
24
|
+
|
25
|
+
@assemblyinfo_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfo.test")
|
26
|
+
File.delete @assemblyinfo_file if File.exist? @assemblyinfo_file
|
27
|
+
end
|
28
|
+
|
29
|
+
def use_input_file
|
30
|
+
@input_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfoInput.test")
|
31
|
+
end
|
32
|
+
|
33
|
+
def build_and_read_assemblyinfo_file(assemblyinfo)
|
34
|
+
setup_assemblyinfo_file
|
35
|
+
|
36
|
+
assemblyinfo.input_file = @input_file unless @input_file.nil?
|
37
|
+
assemblyinfo.output_file = @assemblyinfo_file
|
38
|
+
assemblyinfo.execute
|
39
|
+
|
40
|
+
contents = ''
|
41
|
+
File.open(@assemblyinfo_file, "r") do |f|
|
42
|
+
contents = f.read
|
43
|
+
end
|
44
|
+
contents
|
45
|
+
end
|
46
|
+
|
47
|
+
def yaml_file
|
48
|
+
return File.join(File.dirname(__FILE__), "AssemblyInfo", "assemblyinfo.yml")
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -1,26 +1,26 @@
|
|
1
|
-
class XmlValidator
|
2
|
-
require 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
|
3
|
-
require 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
|
4
|
-
|
5
|
-
include System::Xml
|
6
|
-
include System::Xml::Schema
|
7
|
-
|
8
|
-
def self.validate(xml_file, xsd_file)
|
9
|
-
xml = File.read(xml_file)
|
10
|
-
|
11
|
-
settings = XmlReaderSettings.new
|
12
|
-
settings.validation_type = ValidationType.Schema;
|
13
|
-
settings.schemas.add(nil, xsd_file)
|
14
|
-
|
15
|
-
is_valid = true
|
16
|
-
settings.validation_event_handler { |s, e|
|
17
|
-
is_valid = false if e.severity == XmlSeverityType.error
|
18
|
-
}
|
19
|
-
|
20
|
-
reader = XmlReader.create(System::IO::StringReader.new(xml), settings)
|
21
|
-
while reader.read
|
22
|
-
end
|
23
|
-
|
24
|
-
return is_valid
|
25
|
-
end
|
26
|
-
end
|
1
|
+
class XmlValidator
|
2
|
+
require 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
|
3
|
+
require 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
|
4
|
+
|
5
|
+
include System::Xml
|
6
|
+
include System::Xml::Schema
|
7
|
+
|
8
|
+
def self.validate(xml_file, xsd_file)
|
9
|
+
xml = File.read(xml_file)
|
10
|
+
|
11
|
+
settings = XmlReaderSettings.new
|
12
|
+
settings.validation_type = ValidationType.Schema;
|
13
|
+
settings.schemas.add(nil, xsd_file)
|
14
|
+
|
15
|
+
is_valid = true
|
16
|
+
settings.validation_event_handler { |s, e|
|
17
|
+
is_valid = false if e.severity == XmlSeverityType.error
|
18
|
+
}
|
19
|
+
|
20
|
+
reader = XmlReader.create(System::IO::StringReader.new(xml), settings)
|
21
|
+
while reader.read
|
22
|
+
end
|
23
|
+
|
24
|
+
return is_valid
|
25
|
+
end
|
26
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
require 'albacore/msbuild'
|
2
|
-
|
3
|
-
class MSBuildTestData
|
4
|
-
|
5
|
-
attr_accessor :msbuild_path, :solution_path, :config_mode, :output_path
|
6
|
-
|
7
|
-
def initialize(config_mode='Debug')
|
8
|
-
@solution_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution.sln")
|
9
|
-
@msbuild_path = "C:\\Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe"
|
10
|
-
@config_mode = config_mode
|
11
|
-
|
12
|
-
setup_output
|
13
|
-
end
|
14
|
-
|
15
|
-
def setup_output
|
16
|
-
@output_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution", "bin", "#{@config_mode}", "TestSolution.dll")
|
17
|
-
File.delete @output_path if File.exist? @output_path
|
18
|
-
end
|
19
|
-
|
20
|
-
def msbuild(path_to_msbuild=nil)
|
21
|
-
@msbuild = MSBuild.new
|
22
|
-
|
23
|
-
if (path_to_msbuild)
|
24
|
-
@msbuild_path = path_to_msbuild
|
25
|
-
@msbuild.command = path_to_msbuild
|
26
|
-
end
|
27
|
-
|
28
|
-
@msbuild.extend(SystemPatch)
|
29
|
-
@msbuild
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
1
|
+
require 'albacore/msbuild'
|
2
|
+
|
3
|
+
class MSBuildTestData
|
4
|
+
|
5
|
+
attr_accessor :msbuild_path, :solution_path, :config_mode, :output_path
|
6
|
+
|
7
|
+
def initialize(config_mode='Debug')
|
8
|
+
@solution_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution.sln")
|
9
|
+
@msbuild_path = "C:\\Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe"
|
10
|
+
@config_mode = config_mode
|
11
|
+
|
12
|
+
setup_output
|
13
|
+
end
|
14
|
+
|
15
|
+
def setup_output
|
16
|
+
@output_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution", "bin", "#{@config_mode}", "TestSolution.dll")
|
17
|
+
File.delete @output_path if File.exist? @output_path
|
18
|
+
end
|
19
|
+
|
20
|
+
def msbuild(path_to_msbuild=nil)
|
21
|
+
@msbuild = MSBuild.new
|
22
|
+
|
23
|
+
if (path_to_msbuild)
|
24
|
+
@msbuild_path = path_to_msbuild
|
25
|
+
@msbuild.command = path_to_msbuild
|
26
|
+
end
|
27
|
+
|
28
|
+
@msbuild.extend(SystemPatch)
|
29
|
+
@msbuild
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -1,33 +1,33 @@
|
|
1
|
-
require 'albacore/nant'
|
2
|
-
|
3
|
-
class NAntTestData
|
4
|
-
|
5
|
-
attr_accessor :nant_path, :build_file_path, :output_path
|
6
|
-
|
7
|
-
def initialize(config_mode='Debug',version='0.0.1')
|
8
|
-
@config_mode = config_mode
|
9
|
-
@version = version
|
10
|
-
|
11
|
-
@nant_path = File.join(File.dirname(__FILE__), "Tools", "NAnt-0.85", "bin", "NAnt.exe")
|
12
|
-
@build_file_path = File.join(File.dirname(__FILE__), "TestSolution", "TestSolution.build")
|
13
|
-
setup_output
|
14
|
-
end
|
15
|
-
|
16
|
-
def setup_output
|
17
|
-
@output_root = File.join(File.dirname(__FILE__), "TestSolution", "out")
|
18
|
-
@output_path = File.join(@output_root, "#{@version}", "#{@config_mode}")
|
19
|
-
clean_output
|
20
|
-
end
|
21
|
-
|
22
|
-
def clean_output
|
23
|
-
FileUtils.rm_rf @output_root
|
24
|
-
end
|
25
|
-
|
26
|
-
def nant
|
27
|
-
@nant = NAnt.new
|
28
|
-
|
29
|
-
@nant.extend(SystemPatch)
|
30
|
-
@nant
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
1
|
+
require 'albacore/nant'
|
2
|
+
|
3
|
+
class NAntTestData
|
4
|
+
|
5
|
+
attr_accessor :nant_path, :build_file_path, :output_path
|
6
|
+
|
7
|
+
def initialize(config_mode='Debug',version='0.0.1')
|
8
|
+
@config_mode = config_mode
|
9
|
+
@version = version
|
10
|
+
|
11
|
+
@nant_path = File.join(File.dirname(__FILE__), "Tools", "NAnt-0.85", "bin", "NAnt.exe")
|
12
|
+
@build_file_path = File.join(File.dirname(__FILE__), "TestSolution", "TestSolution.build")
|
13
|
+
setup_output
|
14
|
+
end
|
15
|
+
|
16
|
+
def setup_output
|
17
|
+
@output_root = File.join(File.dirname(__FILE__), "TestSolution", "out")
|
18
|
+
@output_path = File.join(@output_root, "#{@version}", "#{@config_mode}")
|
19
|
+
clean_output
|
20
|
+
end
|
21
|
+
|
22
|
+
def clean_output
|
23
|
+
FileUtils.rm_rf @output_root
|
24
|
+
end
|
25
|
+
|
26
|
+
def nant
|
27
|
+
@nant = NAnt.new
|
28
|
+
|
29
|
+
@nant.extend(SystemPatch)
|
30
|
+
@nant
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
class NCoverConsoleTestData
|
2
|
-
attr_accessor :ncoverpath, :nunitpath, :xml_coverage_output, :html_coverage_output, :working_directory
|
3
|
-
attr_accessor :test_assembly, :failing_test_assembly, :mspecpath, :mspec_html_output, :mspec_test_assembly
|
4
|
-
attr_accessor :test_assembly_with_spaces
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
@ncoverpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NCover-v3.3', 'NCover.Console.exe')
|
8
|
-
@nunitpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
9
|
-
@xml_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'test-coverage.xml')
|
10
|
-
@html_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'html', 'test-coverage.html')
|
11
|
-
@working_directory = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit')
|
12
|
-
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
|
13
|
-
@test_assembly_with_spaces = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies/with spaces/', 'TestSolution.Tests.dll')
|
14
|
-
@failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
|
15
|
-
|
16
|
-
@mspecpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'Machine.Specification-v0.2', 'Machine.Specifications.ConsoleRunner.exe')
|
17
|
-
@mspec_html_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'mspec', 'html')
|
18
|
-
@mspec_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'mspec', 'assemblies', 'TestSolution.MSpecTests.dll')
|
19
|
-
end
|
1
|
+
class NCoverConsoleTestData
|
2
|
+
attr_accessor :ncoverpath, :nunitpath, :xml_coverage_output, :html_coverage_output, :working_directory
|
3
|
+
attr_accessor :test_assembly, :failing_test_assembly, :mspecpath, :mspec_html_output, :mspec_test_assembly
|
4
|
+
attr_accessor :test_assembly_with_spaces
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@ncoverpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NCover-v3.3', 'NCover.Console.exe')
|
8
|
+
@nunitpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
9
|
+
@xml_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'test-coverage.xml')
|
10
|
+
@html_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'html', 'test-coverage.html')
|
11
|
+
@working_directory = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit')
|
12
|
+
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
|
13
|
+
@test_assembly_with_spaces = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies/with spaces/', 'TestSolution.Tests.dll')
|
14
|
+
@failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
|
15
|
+
|
16
|
+
@mspecpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'Machine.Specification-v0.2', 'Machine.Specifications.ConsoleRunner.exe')
|
17
|
+
@mspec_html_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'mspec', 'html')
|
18
|
+
@mspec_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'mspec', 'assemblies', 'TestSolution.MSpecTests.dll')
|
19
|
+
end
|
20
20
|
end
|
@@ -1,26 +1,26 @@
|
|
1
|
-
class NCoverReportTestData
|
2
|
-
@filedir = File.dirname(__FILE__)
|
3
|
-
@output_folder = File.expand_path(File.join(@filedir, "CodeCoverage", "report", "output"))
|
4
|
-
|
5
|
-
def self.command
|
6
|
-
File.expand_path(File.join(@filedir, "Tools", "NCover-v3.3", "NCover.Reporting.exe"))
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.coverage_file
|
10
|
-
File.expand_path(File.join(@filedir, "CodeCoverage", "report", "coverage.xml"))
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.output_folder
|
14
|
-
@output_folder
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.clean_output_folder
|
18
|
-
FileUtils.rmtree(@output_folder)
|
19
|
-
Dir.mkdir(@output_folder) unless File.exist?(@output_folder)
|
20
|
-
sleep(3) # this is a hack to work around the slow hard drive in my laptop, which caused failing tests w/ write-through-cache.
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.summary_output_file
|
24
|
-
File.join(NCoverReportTestData.output_folder, "summary.html")
|
25
|
-
end
|
26
|
-
end
|
1
|
+
class NCoverReportTestData
|
2
|
+
@filedir = File.dirname(__FILE__)
|
3
|
+
@output_folder = File.expand_path(File.join(@filedir, "CodeCoverage", "report", "output"))
|
4
|
+
|
5
|
+
def self.command
|
6
|
+
File.expand_path(File.join(@filedir, "Tools", "NCover-v3.3", "NCover.Reporting.exe"))
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.coverage_file
|
10
|
+
File.expand_path(File.join(@filedir, "CodeCoverage", "report", "coverage.xml"))
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.output_folder
|
14
|
+
@output_folder
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.clean_output_folder
|
18
|
+
FileUtils.rmtree(@output_folder)
|
19
|
+
Dir.mkdir(@output_folder) unless File.exist?(@output_folder)
|
20
|
+
sleep(3) # this is a hack to work around the slow hard drive in my laptop, which caused failing tests w/ write-through-cache.
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.summary_output_file
|
24
|
+
File.join(NCoverReportTestData.output_folder, "summary.html")
|
25
|
+
end
|
26
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
require 'nokogiri'
|
2
|
-
|
3
|
-
class XmlValidator
|
4
|
-
def self.validate(xml_file, schema_file)
|
5
|
-
schema = Nokogiri::XML::Schema(File.read(schema_file))
|
6
|
-
doc = Nokogiri::XML::Document.parse(File.read(xml_file))
|
7
|
-
|
8
|
-
validation = schema.validate(doc)
|
9
|
-
validation.each do |error|
|
10
|
-
raise error.message
|
11
|
-
end
|
12
|
-
|
13
|
-
return validation.length == 0
|
14
|
-
end
|
15
|
-
end
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
class XmlValidator
|
4
|
+
def self.validate(xml_file, schema_file)
|
5
|
+
schema = Nokogiri::XML::Schema(File.read(schema_file))
|
6
|
+
doc = Nokogiri::XML::Document.parse(File.read(xml_file))
|
7
|
+
|
8
|
+
validation = schema.validate(doc)
|
9
|
+
validation.each do |error|
|
10
|
+
raise error.message
|
11
|
+
end
|
12
|
+
|
13
|
+
return validation.length == 0
|
14
|
+
end
|
15
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
class OutputTestData
|
2
|
-
|
3
|
-
@@from = File.expand_path(File.join(File.dirname(__FILE__), 'src'))
|
4
|
-
@@to = File.expand_path(File.join(File.dirname(__FILE__), 'out'))
|
5
|
-
|
6
|
-
def self.from
|
7
|
-
@@from
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.to
|
11
|
-
@@to
|
12
|
-
end
|
1
|
+
class OutputTestData
|
2
|
+
|
3
|
+
@@from = File.expand_path(File.join(File.dirname(__FILE__), 'src'))
|
4
|
+
@@to = File.expand_path(File.join(File.dirname(__FILE__), 'out'))
|
5
|
+
|
6
|
+
def self.from
|
7
|
+
@@from
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.to
|
11
|
+
@@to
|
12
|
+
end
|
13
13
|
end
|
data/spec/support/ziptestdata.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
class ZipTestData
|
2
|
-
|
3
|
-
@@folder = File.expand_path(File.join(File.dirname(__FILE__), 'zip'))
|
4
|
-
@@output_folder = File.expand_path(File.join(File.dirname(__FILE__), 'zip_output'))
|
5
|
-
|
6
|
-
def self.folder
|
7
|
-
@@folder
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.output_folder
|
11
|
-
@@output_folder
|
12
|
-
end
|
1
|
+
class ZipTestData
|
2
|
+
|
3
|
+
@@folder = File.expand_path(File.join(File.dirname(__FILE__), 'zip'))
|
4
|
+
@@output_folder = File.expand_path(File.join(File.dirname(__FILE__), 'zip_output'))
|
5
|
+
|
6
|
+
def self.folder
|
7
|
+
@@folder
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.output_folder
|
11
|
+
@@output_folder
|
12
|
+
end
|
13
13
|
end
|