Class: Turn::CrossRunner

Inherits:
IsoRunner show all
Defined in:
lib/turn/runners/crossrunner.rb

Overview

Cross Runner

Cross Runner runs test in pairs.

TODO: This needs work in the test_loop_runner.

It needs to show the files being cross tested.

TODO: Cross runner output needs to be fixed

Constant Summary

Constants included from Colorize

Turn::Colorize::COLORIZE, Turn::Colorize::ERROR, Turn::Colorize::FAIL, Turn::Colorize::PASS

Instance Attribute Summary

Attributes inherited from IsoRunner

#reporter

Instance Method Summary collapse

Instance Method Details

#startObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/turn/runners/crossrunner.rb', line 15

def start
  suite = TestSuite.new

  files = @controller.files
  viles = @controller.files # TODO: viles this selectable

  #files = files.select{ |f| File.extname(f) == '.rb' and File.file?(f) }
  #viles = viles.select{ |f| File.extname(f) == '.rb' and File.file?(f) }

  max = (files+viles).collect{ |f| f.size }.max

  pairs = files.inject([]){ |m, f| viles.collect{ |v| m << [f,v] }; m }
  pairs = pairs.reject{ |f,v| f == v }

  testruns = pairs.collect do |file, versus|
    name = "%-#{max}s %-#{max}s" % [file, versus]
    suite.new_case(name, file, versus)
  end

  test_loop_runner(suite)
end