Class: Albacore::TestRunner::Task

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/albacore/task_types/test_runner.rb

Instance Method Summary collapse

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Constructor Details

#initialize(opts) ⇒ Task

Returns a new instance of Task.



111
112
113
# File 'lib/albacore/task_types/test_runner.rb', line 111

def initialize opts
  @opts = opts
end

Instance Method Details

#executeObject

Raises:

  • (ArgumentError)


115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/albacore/task_types/test_runner.rb', line 115

def execute
  raise ArgumentError, 'missing :exe' unless @opts.get :exe
  raise ArgumentError, 'missing :files' unless @opts.get :files
  raise ArgumentError, 'cannot specify both execute_as_batch and is_ms_test' if @opts.get :execute_as_batch and @opts.get :is_ms_test
  raise ArgumentError, 'cannot specify both execute_as_batch and is_ms_test' if @opts.get :execute_as_batch and @opts.get :copy_local

  @opts.get(:files).each do |dll|
    raise ArgumentError, "could not find test dll '#{dll}' in dir #{FileUtils.pwd}" unless File.exists? dll
  end

  commands = []
  if @opts.get(:execute_as_batch)
    commands = build_command_for_all_dlls
  else
    commands = @opts.get(:files).map { |dll| build_command_for dll }
  end

  execute_commands commands
end