summaryrefslogtreecommitdiff
path: root/lib/runit/cui/testrunner.rb
diff options
context:
space:
mode:
authorntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-12 03:12:14 +0000
committerntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-12 03:12:14 +0000
commit04f2b8f7bf16ad37d3c28f0e06eb02d63ab6a731 (patch)
tree4354dc87a540b777a7eb6a2276f44be51ec8bebb /lib/runit/cui/testrunner.rb
parent4a44a6d474cc793d75344b3a0e4c9b0031802689 (diff)
Initial revision
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/runit/cui/testrunner.rb')
-rw-r--r--lib/runit/cui/testrunner.rb51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/runit/cui/testrunner.rb b/lib/runit/cui/testrunner.rb
new file mode 100644
index 0000000000..0106b6c859
--- /dev/null
+++ b/lib/runit/cui/testrunner.rb
@@ -0,0 +1,51 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+require 'test/unit/ui/console/testrunner'
+require 'runit/testresult'
+
+module RUNIT
+ module CUI
+ class TestRunner < Test::Unit::UI::Console::TestRunner
+ @@quiet_mode = false
+
+ def self.run(suite)
+ self.new().run(suite)
+ end
+
+ def initialize
+ super nil
+ end
+
+ def run(suite, quiet_mode=@@quiet_mode)
+ @suite = suite
+ def @suite.suite
+ self
+ end
+ @output_level = (quiet_mode ? PROGRESS_ONLY : NORMAL)
+ start
+ end
+
+ def create_mediator(suite)
+ mediator = Test::Unit::UI::TestRunnerMediator.new(suite)
+ class << mediator
+ attr_writer :result_delegate
+ def create_result
+ return @result_delegate.create_result
+ end
+ end
+ mediator.result_delegate = self
+ return mediator
+ end
+
+ def create_result
+ return RUNIT::TestResult.new
+ end
+
+ def self.quiet_mode=(boolean)
+ @@quiet_mode = boolean
+ end
+ end
+ end
+end