Sha256: b44525c6fa54d8ea0f3a558a3ccb06b85c6849558e025ad302703cc0dad00419
Contents?: true
Size: 1.58 KB
Versions: 3
Compression:
Stored size: 1.58 KB
Contents
require_relative('./commandarray.rb') class Test < CommandArray def update # rspec tests, 'rspec --pattern="**/*.spec"' self.add 'rspec' if(Dir.glob("**/*spec.rb").length > 0) test_files=collect_nunit_files if(defined?(DEV_TASKS) && DEV_TASKS.has_key?(:files) && DEV_TASKS[:files].has_key?(:test)) test_files=DEV_TASKS[:files][:test] end if(!test_files.nil?) test_files.each {|tf| if(tf.include?('.dll')) nunit_dll=tf if(nunit_dll.include?('x86')) self.add "\"#{Test.nunit_console_x86}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\"" else self.add "\"#{Test.nunit_console}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\"" end end } end end def collect_nunit_files results=Array.new Dir.glob("*.csproj").each{|p| text = File.read(p) if(text.include?("nunit.framework.dll")) # extract AssemblyName of form: <AssemblyName>MyLibrary.Test</AssemblyName> assemblyName=text[/<AssemblyName>([\w\.]+)</,1] outputPath=text[/Release[.\w\W]+<OutputPath>([\w\.\\]+)</,1] if(!assemblyName.nil? && !outputPath.nil?) results << "#{outputPath}\\#{assemblyName}.dll".gsub("\\\\","\\").gsub('/','\\') end end } results end def self.nunit_console "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe" end def self.nunit_console_x86 "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console-x86.exe" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
dev_tasks-1.0.15 | lib/test.rb |
dev_tasks-1.0.14 | lib/test.rb |
dev_tasks-1.0.13 | lib/test.rb |