Sha256: d409eab691e726e6b124ce622840953eb703125a09c111f6f02f0eb13e85c4c9

Contents?: true

Size: 780 Bytes

Versions: 1

Compression:

Stored size: 780 Bytes

Contents

module DeepTest
  class Worker
    def initialize(blackboard = DeepTest::RindaBlackboard.new)
      @blackboard = blackboard
    end

    def run
      while test_case = @blackboard.take_test
        result = run_test_case test_case
        result = run_test_case test_case if result.failed_due_to_deadlock?
        if result.failed_due_to_deadlock?
          result = Test::Unit::TestResult.new
          result.add_run
          result.output = "-deadlock-"
        end
        @blackboard.write_result result
      end
    end
    
    protected
    
    def run_test_case(test_case)
      result = Test::Unit::TestResult.new
      output = capture_stdout do
        test_case.run(result) {|channel,event|}
      end
      result.output = output
      result
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deep_test-1.1.2 lib/deep_test/worker.rb