Fix some rakefile issues

This commit is contained in:
Antony Male 2014-05-06 18:30:04 +01:00
parent 4fa4133248
commit 5cc0ee96d2
3 changed files with 12 additions and 9 deletions

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit.Runners" version="2.6.3" />
<package id="OpenCover" version="4.5.2506" />
<package id="ReportGenerator" version="1.9.1.0" />
</packages>

View File

@ -14,6 +14,12 @@ UNIT_TESTS_DLL = "StyletUnitTests/bin/#{CONFIG}/StyletUnitTests.dll"
COVERAGE_DIR = 'Coverage'
COVERAGE_FILE = File.join(COVERAGE_DIR, 'coverage.xml')
raise "NUnit.Runners not found. Restore NuGet packages" unless NUNIT_TOOLS
raise "OpenCover not found. Restore NuGet packages" unless OPENCOVER_CONSOLE
raise "ReportGenerator not found. Restore NuGet packages" unless REPORT_GENERATOR
directory COVERAGE_DIR
desc "Build Stylet.sln using the current CONFIG (or Debug)"
build :build do |b|
b.sln = "Stylet.sln"
@ -38,9 +44,9 @@ task :nunit do |t|
end
desc "Generate code coverage reports for CONFIG (or Debug)"
task :cover => [:build] do |t|
task :cover => [:build, COVERAGE_DIR] do |t|
sh OPENCOVER_CONSOLE, %Q{-register:user -target:"#{NUNIT_CONSOLE}" -filter:+[Stylet]* -targetargs:"#{UNIT_TESTS_DLL} /noshadow" -output:"#{COVERAGE_FILE}"}
sh REPORT_GENERATOR, %Q{-reports:"#{COVERAGE_FILE}" -targetdir:"#{COVERAGE_DIR}"}
sh REPORT_GENERATOR, %Q{"-reports:#{COVERAGE_FILE}" "-targetdir:#{COVERAGE_DIR}"}
rm 'TestResult.xml'
end

View File

@ -2,4 +2,7 @@
<packages>
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="NUnit" version="2.6.3" targetFramework="net45" />
</packages>
<package id="NUnit.Runners" version="2.6.3" />
<package id="OpenCover" version="4.5.2506" />
<package id="ReportGenerator" version="1.9.1.0" />
</packages>