Class: TestQueue::Runner::TestUnit

Inherits:
TestQueue::Runner show all
Defined in:
lib/test_queue/runner/testunit.rb

Instance Attribute Summary

Attributes inherited from TestQueue::Runner

#concurrency, #exit_when_done, #stats

Instance Method Summary collapse

Methods inherited from TestQueue::Runner

#abort, #after_fork, #after_fork_internal, #around_filter, #awaiting_suites?, #cleanup_worker, #connect_to_relay, #discover_suites, #distribute_queue, #enqueue_discovered_suite, #execute, #execute_internal, #kill_subprocesses, #kill_suite_discovery_process, #kill_workers, #prepare, #queue_status, #reap_suite_discovery_process, #reap_workers, #relay?, #relay_to_master, #spawn_workers, #start_master, #start_relay, #stats_file, #stop_master, #summarize, #summarize_internal, #worker_completed

Constructor Details

#initializeTestUnit

Returns a new instance of TestUnit.



38
39
40
41
42
43
# File 'lib/test_queue/runner/testunit.rb', line 38

def initialize
  if Test::Unit::Collector::Descendant.new.collect.tests.any?
    fail "Do not `require` test files. Pass them via ARGV instead and they will be required as needed."
  end
  super(TestFramework::TestUnit.new)
end

Instance Method Details

#run_worker(iterator) ⇒ Object



45
46
47
48
49
50
# File 'lib/test_queue/runner/testunit.rb', line 45

def run_worker(iterator)
  @suite = Test::Unit::TestSuite.new("specified by test-queue master")
  @suite.iterator = iterator
  res = Test::Unit::UI::Console::TestRunner.new(@suite).start
  res.run_count - res.pass_count
end

#summarize_worker(worker) ⇒ Object



52
53
54
55
# File 'lib/test_queue/runner/testunit.rb', line 52

def summarize_worker(worker)
  worker.summary = worker.output.split("\n").grep(/^\d+ tests?/).first
  worker.failure_output = worker.output.scan(/^Failure:\n(.*)\n=======================*/m).join("\n")
end