dev_tasks 0.0.162 → 0.0.163

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.
Files changed (3) hide show
  1. data/lib/spec.json +1 -1
  2. data/lib/test.rb +25 -10
  3. metadata +1 -1
data/lib/spec.json CHANGED
@@ -1 +1 @@
1
- {"name":"dev_tasks","version":"0.0.162"}
1
+ {"name":"dev_tasks","version":"0.0.163"}
data/lib/test.rb CHANGED
@@ -7,25 +7,40 @@ class Test < CommandArray
7
7
  if(Dir.glob("**/*spec.rb").length > 0)
8
8
  self.add 'rspec'
9
9
  end
10
- # nunit tests, 'nunit-console.exe "C::\\Projects\\MyProjects\\bin\\Release\\MyLib.Test.dll"'
11
- if File.exist? Test.nunit_console
12
- Dir.glob("*.csproj").each{|p|
10
+
11
+ test_files=collect_nunit_files
12
+ if(defined?(DEV_TASKS) && DEV_TASKS.has_key?(:files) && DEV_TASKS[:files].has_key?(:test))
13
+ test_files=DEV_TASKS[:files][:test]
14
+ end
15
+
16
+ if(!test_files.nil?)
17
+ test_files.each {|tf|
18
+ if(tf.include?('.dll'))
19
+ nunit_dll=tf
20
+ if(outputPath.include?('x86'))
21
+ self.add "\"#{Test.nunit_console_x86}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
22
+ else
23
+ self.add "\"#{Test.nunit_console}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
24
+ end
25
+ end
26
+ }
27
+ end
28
+ end
29
+
30
+ def collect_nunit_files
31
+ results=Array.new
32
+ Dir.glob("*.csproj").each{|p|
13
33
  text = File.read(p)
14
34
  if(text.include?("nunit.framework.dll"))
15
35
  # extract AssemblyName of form: <AssemblyName>MyLibrary.Test</AssemblyName>
16
36
  assemblyName=text[/<AssemblyName>([\w\.]+)</,1]
17
37
  outputPath=text[/Release[.\w\W]+<OutputPath>([\w\.\\]+)</,1]
18
38
  if(!assemblyName.nil? && !outputPath.nil?)
19
- nunit_dll = "#{Rake.application.original_dir}\\#{outputPath}\\#{assemblyName}.dll".gsub("\\\\","\\").gsub('/','\\')
20
- if(outputPath.include?('x86'))
21
- self.add "\"#{Test.nunit_console_x86}\" \"#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
22
- else
23
- self.add "\"#{Test.nunit_console}\" \"#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
24
- end
39
+ results << "#{outputPath}\\#{assemblyName}.dll".gsub("\\\\","\\").gsub('/','\\')
25
40
  end
26
41
  end
27
42
  }
28
- end
43
+ results
29
44
  end
30
45
 
31
46
  def self.nunit_console
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.162
4
+ version: 0.0.163
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: