Sha256: e0cb99014250c0c3cd8e6109d7ff224a696efd27011bcce74db40be4c4fe2ce8

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

require "albacore/albacoretask"
require "albacore/config/mstestconfig"

class MSTest
  TaskName = :mstest
  
  include Albacore::Task
  include Albacore::RunCommand
  include Configuration::MSTest
  
  attr_reader :no_logo
  
  attr_array  :assemblies, 
              :tests
  
  def initialize()
    @command = "mstest"

    super()
    update_attributes(mstest.to_hash)
  end
  
  def execute()
    result = run_command("MSTest", build_parameters)
    fail_with_message("MSTest failed, see the build log for more details.") unless result
  end  
    
  def build_parameters
    p = []
    p << @assemblies.map { |asm| "/testcontainer:\"#{asm}\"" } if @assemblies
    p << @tests.map { |test| "/test:#{test}"} if @tests
    p << "/nologo" if @no_logo
    p
  end
  
  def build_command_line
    c = []
    c << @command
    c << build_parameters
    c << @parameters
    c
  end

  def no_logo
    @no_logo = true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
albacore-1.0.0 lib/albacore/mstest.rb
albacore-1.0.0.rc.3 lib/albacore/mstest.rb