source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 1.1 KB
Line 
1#--
2#
3# Author:: Nathaniel Talbott.
4# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
5# License:: Ruby license.
6
7module Test
8 module Unit
9 module UI
10
11 SILENT = 0
12 PROGRESS_ONLY = 1
13 NORMAL = 2
14 VERBOSE = 3
15
16 # Provides some utilities common to most, if not all,
17 # TestRunners.
18 #
19 #--
20 #
21 # Perhaps there ought to be a TestRunner superclass? There
22 # seems to be a decent amount of shared code between test
23 # runners.
24
25 module TestRunnerUtilities
26
27 # Creates a new TestRunner and runs the suite.
28 def run(suite, output_level=NORMAL)
29 return new(suite, output_level).start
30 end
31
32 # Takes care of the ARGV parsing and suite
33 # determination necessary for running one of the
34 # TestRunners from the command line.
35 def start_command_line_test
36 if ARGV.empty?
37 puts "You should supply the name of a test suite file to the runner"
38 exit
39 end
40 require ARGV[0].gsub(/.+::/, '')
41 new(eval(ARGV[0])).start
42 end
43 end
44 end
45 end
46end
Note: See TracBrowser for help on using the repository browser.