Class: Test

Inherits:
Array show all
Defined in:
lib/test.rb

Overview

nunit dlls may be specified with NUNIT=FileList.new(‘*/.Test.dll’)

for nunit dlls that must be run in x86 mode, NUNIT_x86=FileList.new(‘*/.x86.Test.dll’)

Constant Summary collapse

@@nunit_console =
''
@@nunit_console_x86 =
''

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#add, #execute, #to_html

Class Method Details

.nunit_consoleObject



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/test.rb', line 30

def self.nunit_console
	if(!File.exists?(@@nunit_console))
		if(defined?(NUNIT_CONSOLE))
			@@nunit_console = NUNIT_CONSOLE 
		end
		@@nunit_console = "C:\\Program Files (x86)\\NUnit 2.6.4\\bin\\nunit-console.exe" if(!File.exists?(@@nunit_console))
		@@nunit_console = "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe" if(!File.exists?(@@nunit_console))
	end
	if(!File.exists?(@@nunit_console))
		raise "unable to locate nunit-console.exe, assign NUNIT_CONSOLE to the correct location."
	end
	@@nunit_console
end

.nunit_console_x86Object



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/test.rb', line 45

def self.nunit_console_x86
	if(!File.exists?(@@nunit_console_x86))
		if(defined?(NUNIT_CONSOLE_X86))
			@@nunit_console_x86 = NUNIT_CONSOLE_X86 
		end
		@@nunit_console_x86 = "C:\\Program Files (x86)\\NUnit 2.6.4\\bin\\nunit-console-x86.exe" if(!File.exists?(@@nunit_console_x86))
		@@nunit_console_x86 = "C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console-x86.exe" if(!File.exists?(@@nunit_console_x86))
	end
	if(!File.exists?(@@nunit_console_x86))
		raise "unable to locate nunit-console-x86.exe, assign NUNIT_CONSOLE_X86 to the correct location."
	end
	@@nunit_console_x86
end

Instance Method Details

#updateObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/test.rb', line 9

def update
	add 'rspec' if File.exists?('spec')

	if(defined?(NUNIT))
		NUNIT.each{|nunit_dll|
			add "\"#{Test.nunit_console}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
		}
	end

	if(defined?(NUNIT_X86))
		NUNIT_X86.each{|nunit_dll|
			add "\"#{Test.nunit_console_x86}\" \"#{Rake.application.original_dir}\\#{nunit_dll}\" /xml:\"#{nunit_dll}.TestResults.xml\""
		}
	end

	if(defined?(TESTS))
		TEST.each{|t| add t}
	end
end