4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/nunit.rb', line 4
def self.create_task(tasks, options)
nunitTask = nil
tests = Array.new
if options[:unit_test_projects].any?
tests = options[:unit_test_projects]
elsif options[:unit_test_list_file] != nil and File::exists?(options[:unit_test_list_file])
file = options[:unit_test_list_file]
tests = NUnitRunner.readFromFile(file)
else
Dir.glob('**/*.{Testing,Tests}.csproj').each do |f|
test = File.basename(f, ".csproj")
tests.push test
end
end
if !tests.empty?
nunitTask = Rake::Task.define_task :unit_test do
runner = NUnitRunner.new options
runner.executeTests tests
end
nunitTask.enhance [:compile]
nunitTask.add_description "Runs unit tests for " + tests.join(', ')
end
if tasks.integration_test != nil
integrationTask = Rake::Task.define_task :integration_test do
runner = NUnitRunner.new options
runner.executeTests tasks.integration_test
end
integrationTask.enhance [:compile]
integrationTask.add_description "integration tests: #{tasks.integration_test.join(', ')}"
end
end
|