Class: Test::Unit::UI::GTK2::TestRunner

Inherits:
UI::TestRunner
  • Object
show all
Defined in:
lib/test/unit/ui/gtk2/testrunner.rb

Instance Method Summary collapse

Constructor Details

#initialize(suite, options = {}) ⇒ TestRunner

def start



441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 441

def initialize(suite, options={})
  super
  @result = nil

  @runner = Thread.current
  @restart_signal = Class.new(Exception)
  @viewer = Thread.start do
    @runner.join rescue @runner.run
    Gtk.main
  end
  @viewer.join rescue nil # wait deadlock to handshake
end

Instance Method Details

#progress_panelObject



235
236
237
238
239
240
241
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 235

def progress_panel
  lazy_initialize(:progress_panel) do
    @progress_panel = Gtk::HBox.new(false, 10)
    @progress_panel.border_width = 10
    @progress_panel.pack_start(test_progress_bar, true, true, 0)
  end
end

#run_buttonObject

def progress_panel



243
244
245
246
247
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 243

def run_button
  lazy_initialize(:run_button) do
    @run_button = Gtk::Button.new("Run")
  end
end

#startObject



433
434
435
436
437
438
439
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 433

def start
  setup_mediator
  setup_ui
  attach_to_mediator
  start_ui
  @result
end

#test_finished(result) ⇒ Object



328
329
330
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 328

def test_finished(result)
  test_progress_bar.fraction += 1.0 / @count
end