Line | |
---|
1 | #--
|
---|
2 | #
|
---|
3 | # Author:: Nathaniel Talbott.
|
---|
4 | # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
---|
5 | # License:: Ruby license.
|
---|
6 |
|
---|
7 | module 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
|
---|
46 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.