Sha256: 5548e500bc00bf6ad0022e961009335492c7eb9b582a6de9f1c794d142b48e83

Contents?: true

Size: 987 Bytes

Versions: 9

Compression:

Stored size: 987 Bytes

Contents

module Turn
  require 'turn/runners/isorunner'

  # = 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
  class CrossRunner < IsoRunner

    #
    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

  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
TwP-turn-0.5.1 lib/turn/runners/crossrunner.rb
TwP-turn-0.6.0 lib/turn/runners/crossrunner.rb
turn-0.7.0 lib/turn/runners/crossrunner.rb
turn-0.6.3 lib/turn/runners/crossrunner.rb
turn-0.6.2 lib/turn/runners/crossrunner.rb
turn-0.6.1 lib/turn/runners/crossrunner.rb
turn-0.5.1 lib/turn/runners/crossrunner.rb
turn-0.4.0 lib/turn/runners/crossrunner.rb
turn-0.6.0 lib/turn/runners/crossrunner.rb