Sha256: b4077cf706ebb2ee202cd8b248d47b9e0c6f35f28616afd0f63f08ffd6144547

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

module Physique
  class TestConfig
    self.extend Albacore::ConfigDSL

    # Path to test runner executable
    attr_path :exe

    # Path to test runner executable
    attr_writer :files

    def opts
      Map.new({
        exe: @exe,
        files: @files
      })
    end
  end

  class TestsTasksBuilder < TasksBuilder
    def build_tasks
      add_test_tasks
    end

    def add_test_tasks
      configuration = solution.compile.configuration
      package_dir = solution.nuget.restore_location

      task = test_runner :test => test_dependencies do |tests|
        tests.files = FileList["**/*.Tests/bin/#{configuration}/*.Tests.dll"]
        tests.exe = locate_tool("#{package_dir}/NUnit.Runners.*/tools/nunit-console.exe")
        tests.parameters.add('/labels')
        tests.parameters.add('/trace=Verbose')
      end
      task.add_description 'Run unit tests'
    end

    def test_dependencies
      dependencies = [ :compile ]
      dependencies << 'db:rebuild' unless solution.migrator.nil?
      dependencies
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
physique-0.3.0 lib/physique/task_builders/test.rb