dev_tasks 0.0.162 → 0.0.163
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spec.json +1 -1
- data/lib/test.rb +25 -10
- metadata +1 -1
data/lib/spec.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"dev_tasks","version":"0.0.
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
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
|
-
|
43
|
+
results
|
29
44
|
end
|
30
45
|
|
31
46
|
def self.nunit_console
|