diff --git a/build_support/BuildUtils.rb b/build_support/BuildUtils.rb index 801de002..0d6739d0 100644 --- a/build_support/BuildUtils.rb +++ b/build_support/BuildUtils.rb @@ -17,7 +17,7 @@ def initialize(command, working_directory, framework, flags) def run(assemblies) assemblies.each do |assem| file = File.expand_path("#{@working_directory}/#{assem}") - sh "#{@cmd} \"#{file}\"" + Kernel::system("#{@cmd} \"#{file}\"") end end end @@ -63,7 +63,7 @@ def self.runProjFile(attributes) targetsValue += " /t:#{target}" end - sh "#{msbuildFile} #{projFile} #{targetsValue} #{switchesValue}" + Kernel::system("#{msbuildFile} #{projFile} #{targetsValue} #{switchesValue}") end end @@ -76,7 +76,7 @@ def self.compile(attributes) frameworkDir = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', 'v4.0.30319') aspNetCompiler = File.join(frameworkDir, 'aspnet_compiler.exe') - sh "#{aspNetCompiler} -nologo -errorstack -c -p #{webPhysDir} -v #{webVirDir}" + Kernel::system("#{aspNetCompiler} -nologo -errorstack -c -p #{webPhysDir} -v #{webVirDir}") end end @@ -109,4 +109,4 @@ def write(file) file.puts erb.result(binding) end end -end \ No newline at end of file +end diff --git a/rakefile.rb b/rakefile.rb index 08aed384..3fc8814c 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -131,18 +131,13 @@ def copyOutputFiles(fromDir, filePattern, outDir) } end -task :tests => [:unit_tests] -desc "Runs unit tests (integration tests?, acceptance-tests?) etc." -task :unit_tests => [:compile] do - Dir.mkdir props[:artifacts] unless exists?(props[:artifacts]) +desc "Runs unit tests" +nunit :tests => [:compile] do |nunit| - runner = NUnitRunner.new(File.join('src', 'packages', 'nunit.Runners.2.6.3', 'tools', "nunit-console#{(BUILD_PLATFORM.empty? ? '' : "-#{BUILD_PLATFORM}")}.exe"), - 'tests', - TARGET_FRAMEWORK_VERSION, - ['/nothread', '/nologo', '/labels', "\"/xml=#{File.join(props[:artifacts], 'nunit-test-results.xml')}\""]) - - runner.run ['Magnum.Specs'].map{ |assem| "#{assem}.dll" } + nunit.command = File.join('src', 'packages','NUnit.Runners.2.6.3', 'tools', 'nunit-console.exe') + nunit.options = "/framework=#{CLR_TOOLS_VERSION}", '/nothread', '/nologo', '/labels', "\"/xml=#{File.join(props[:artifacts], 'nunit-test-results.xml')}\"" + nunit.assemblies = FileList[File.join("tests", "Magnum.Specs.dll")] end desc "Target used for the CI server. It both builds, tests and packages."