OSDN Git Service

Updated to tcl 8.4.1
[pf3gnuchains/sourceware.git] / tcl / doc / tcltest.n
1 '\"
2 '\" Copyright (c) 1990-1994 The Regents of the University of California
3 '\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
4 '\" Copyright (c) 1998-1999 Scriptics Corporation
5 '\" Copyright (c) 2000 Ajuba Solutions
6 '\" Contributions from Don Porter, NIST, 2002. (not subject to US copyright)
7 '\"
8 '\" See the file "license.terms" for information on usage and redistribution
9 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 '\" 
11 '\" RCS: @(#) $Id$
12 '\" 
13 .so man.macros
14 .TH "tcltest" n 2.1 tcltest "Tcl Bundled Packages"
15 .BS
16 '\" Note:  do not modify the .SH NAME line immediately below!
17 .SH NAME
18 tcltest \- Test harness support code and utilities
19 .SH SYNOPSIS
20 .nf
21 \fBpackage require tcltest ?2.1?\fR
22 .sp
23 \fBtcltest::test \fIname description ?option value ...?\fR
24 \fBtcltest::test \fIname description ?constraints? body result\fR
25 .sp
26 \fBtcltest::loadTestedCommands\fR
27 \fBtcltest::makeDirectory \fIname ?directory?\fR
28 \fBtcltest::removeDirectory \fIname ?directory?\fR
29 \fBtcltest::makeFile \fIcontents name ?directory?\fR
30 \fBtcltest::removeFile \fIname ?directory?\fR
31 \fBtcltest::viewFile \fIname ?directory?\fR
32 \fBtcltest::cleanupTests \fI?runningMultipleTests?\fR
33 \fBtcltest::runAllTests\fR
34 .sp
35 .VS 2.1
36 \fBtcltest::configure\fR
37 \fBtcltest::configure \fIoption\fR
38 \fBtcltest::configure \fIoption value ?option value ...?\fR
39 \fBtcltest::customMatch \fImode command\fR
40 .VE
41 \fBtcltest::testConstraint \fIconstraint ?value?\fR
42 \fBtcltest::outputChannel \fI?channelID?\fR
43 \fBtcltest::errorChannel \fI?channelID?\fR
44 \fBtcltest::interpreter \fI?interp?\fR
45 .sp
46 \fBtcltest::debug \fI?level?\fR
47 \fBtcltest::errorFile \fI?filename?\fR
48 \fBtcltest::limitConstraints \fI?boolean?\fR
49 \fBtcltest::loadFile \fI?filename?\fR
50 \fBtcltest::loadScript \fI?script?\fR
51 \fBtcltest::match \fI?patternList?\fR
52 \fBtcltest::matchDirectories \fI?patternList?\fR
53 \fBtcltest::matchFiles \fI?patternList?\fR
54 \fBtcltest::outputFile \fI?filename?\fR
55 \fBtcltest::preserveCore \fI?level?\fR
56 \fBtcltest::singleProcess \fI?boolean?\fR
57 \fBtcltest::skip \fI?patternList?\fR
58 \fBtcltest::skipDirectories \fI?patternList?\fR
59 \fBtcltest::skipFiles \fI?patternList?\fR
60 \fBtcltest::temporaryDirectory \fI?directory?\fR
61 \fBtcltest::testsDirectory \fI?directory?\fR
62 \fBtcltest::verbose \fI?level?\fR
63 .sp
64 \fBtcltest::test \fIname description optionList\fR
65 \fBtcltest::bytestring \fIstring\fR
66 \fBtcltest::normalizeMsg \fImsg\fR
67 \fBtcltest::normalizePath \fIpathVar\fR
68 \fBtcltest::workingDirectory \fI?dir?\fR
69 .fi
70 .BE
71 .SH DESCRIPTION
72 .PP
73 The \fBtcltest\fR package provides several utility commands useful
74 in the construction of test suites for code instrumented to be
75 run by evaluation of Tcl commands.  Notably the built-in commands
76 of the Tcl library itself are tested by a test suite using the
77 tcltest package.
78 .PP
79 All the commands provided by the \fBtcltest\fR package are defined
80 in and exported from the \fB::tcltest\fR namespace, as indicated in
81 the \fBSYNOPSIS\fR above.  In the following sections, all commands
82 will be described by their simple names, in the interest of brevity.
83 .PP
84 The central command of \fBtcltest\fR is [\fBtest\fR] that defines
85 and runs a test.  Testing with [\fBtest\fR] involves evaluation
86 of a Tcl script and comparing the result to an expected result, as
87 configured and controlled by a number of options.  Several other
88 commands provided by \fBtcltest\fR govern the configuration of
89 [\fBtest\fR] and the collection of many [\fBtest\fR] commands into
90 test suites.
91 .PP
92 See \fBCREATING TEST SUITES WITH TCLTEST\fR below for an extended example
93 of how to use the commands of \fBtcltest\fR to produce test suites
94 for your Tcl-enabled code.
95 .SH COMMANDS
96 .TP
97 \fBtest\fR \fIname description ?option value ...?\fR
98 Defines and possibly runs a test with the name \fIname\fR and
99 description \fIdescription\fR.  The name and description of a test
100 are used in messages reported by [\fBtest\fR] during the
101 test, as configured by the options of \fBtcltest\fR.  The
102 remaining \fIoption value\fR arguments to [\fBtest\fR]
103 define the test, including the scripts to run, the conditions
104 under which to run them, the expected result, and the means
105 by which the expected and actual results should be compared.
106 See \fBTESTS\fR below for a complete description of the valid
107 options and how they define a test.  The [\fBtest\fR] command
108 returns an empty string.  
109 .TP
110 \fBtest\fR \fIname description ?constraints? body result\fR
111 This form of [\fBtest\fR] is provided to support test suites written
112 for version 1 of the \fBtcltest\fR package, and also a simpler
113 interface for a common usage.  It is the same as
114 [\fBtest\fR \fIname description\fB -constraints \fIconstraints\fB -body
115 \fIbody\fB -result \fIresult\fR].  All other options to [\fBtest\fR]
116 take their default values.  When \fIconstraints\fR is omitted, this
117 form of [\fBtest\fR] can be distinguished from the first because
118 all \fIoption\fRs begin with ``-''.
119 .TP
120 \fBloadTestedCommands\fR
121 Evaluates in the caller's context the script specified by 
122 [\fBconfigure -load\fR] or [\fBconfigure -loadfile\fR].
123 Returns the result of that script evaluation, including any error
124 raised by the script.  Use this command and the related
125 configuration options to provide the commands to be tested to
126 the interpreter running the test suite.
127 .TP
128 \fBmakeFile\fR \fIcontents name ?directory?\fR
129 Creates a file named \fIname\fR relative to
130 directory \fIdirectory\fR and write \fIcontents\fR
131 to that file using the encoding [\fBencoding system\fR].
132 If \fIcontents\fR does not end with a newline, a newline
133 will be appended so that the file named \fIname\fR
134 does end with a newline.  Because the system encoding is used,
135 this command is only suitable for making text files.
136 The file will be removed by the next evaluation
137 of [\fBcleanupTests\fR], unless it is removed by
138 [\fBremoveFile\fR] first.  The default value of
139 \fIdirectory\fR is the directory [\fBconfigure -tmpdir\fR].
140 Returns the full path of the file created.  Use this command
141 to create any text file required by a test with contents as needed.
142 .TP
143 \fBremoveFile\fR \fIname ?directory?\fR
144 Forces the file referenced by \fIname\fR to be removed.  This file name
145 should be relative to \fIdirectory\fR.   The default value of
146 \fIdirectory\fR is the directory [\fBconfigure -tmpdir\fR].
147 Returns an empty string.  Use this command to delete files
148 created by [\fBmakeFile\fR].  
149 .TP
150 \fBmakeDirectory\fR \fIname ?directory?\fR
151 Creates a directory named \fIname\fR relative to directory \fIdirectory\fR.
152 The directory will be removed by the next evaluation of [\fBcleanupTests\fR],
153 unless it is removed by [\fBremoveDirectory\fR] first.
154 The default value of \fIdirectory\fR is the directory
155 [\fBconfigure -tmpdir\fR].
156 Returns the full path of the directory created.  Use this command
157 to create any directories that are required to exist by a test.
158 .TP
159 \fBremoveDirectory\fR \fIname ?directory?\fR
160 Forces the directory referenced by \fIname\fR to be removed. This
161 directory should be relative to \fIdirectory\fR.
162 The default value of \fIdirectory\fR is the directory
163 [\fBconfigure -tmpdir\fR].
164 Returns an empty string.  Use this command to delete any directories
165 created by [\fBmakeDirectory\fR].  
166 .TP
167 \fBviewFile\fR \fIfile ?directory?\fR
168 Returns the contents of \fIfile\fR, except for any
169 final newline, just as [\fBread -nonewline\fR] would return.
170 This file name should be relative to \fIdirectory\fR.   
171 The default value of \fIdirectory\fR is the directory
172 [\fBconfigure -tmpdir\fR].  Use this command
173 as a convenient way to turn the contents of a file generated
174 by a test into the result of that test for matching against
175 an expected result.  The contents of the file are read using
176 the system encoding, so its usefulness is limited to text
177 files.
178 .TP
179 \fBcleanupTests\fR
180 Intended to clean up and summarize after several tests have been
181 run.  Typically called once per test file, at the end of the file
182 after all tests have been completed.  For best effectiveness, be
183 sure that the [\fBcleanupTests\fR] is evaluated even if an error
184 occurs earlier in the test file evaluation.  
185 .sp
186 Prints statistics about the tests run and removes files that were
187 created by [\fBmakeDirectory\fR] and [\fBmakeFile\fR] since the
188 last [\fBcleanupTests\fR].  Names of files and directories 
189 in the directory [\fBconfigure -tmpdir\fR] created since
190 the last [\fBcleanupTests\fR], but not created by
191 [\fBmakeFile\fR] or [\fBmakeDirectory\fR] are printed
192 to [\fBoutputChannel\fR].  This command also restores the original
193 shell environment, as described by the ::env
194 array. Returns an empty string.
195 .TP
196 \fBrunAllTests\fR
197 This is a master command meant to run an entire suite of tests,
198 spanning multiple files and/or directories, as governed by
199 the configurable options of \fBtcltest\fR.  See \fBRUNNING ALL TESTS\fR
200 below for a complete description of the many variations possible
201 with [\fBrunAllTests\fR].
202 .SH "CONFIGURATION COMMANDS"
203 .VS
204 .TP
205 \fBconfigure\fR
206 Returns the list of configurable options supported by \fBtcltest\fR.
207 See \fBCONFIGURABLE OPTIONS\fR below for the full list of options,
208 their valid values, and their effect on \fBtcltest\fR operations.
209 .TP
210 \fBconfigure \fIoption\fR
211 Returns the current value of the supported configurable option \fIoption\fR.
212 Raises an error if \fIoption\fR is not a supported configurable option.
213 .TP
214 \fBconfigure \fIoption value ?option value ...?\fR
215 Sets the value of each configurable option \fIoption\fR to the
216 corresponding value \fIvalue\fR, in order.  Raises an error if
217 an \fIoption\fR is not a supported configurable option, or if
218 \fIvalue\fR is not a valid value for the corresponding \fIoption\fR,
219 or if a \fIvalue\fR is not provided.  When an error is raised, the
220 operation of [\fBconfigure\fR] is halted, and subsequent \fIoption value\fR
221 arguments are not processed.
222 .sp
223 If the environment variable \fB::env(TCLTEST_OPTIONS)\fR exists when
224 the \fBtcltest\fR package is loaded (by [\fBpackage require tcltest\fR])
225 then its value is taken as a list of arguments to pass to [\fBconfigure\fR].
226 This allows the default values of the configuration options to be
227 set by the environment.
228 .TP
229 \fBcustomMatch \fImode script\fR
230 Registers \fImode\fR as a new legal value of the \fB-match\fR option
231 to [\fBtest\fR].  When the \fB-match \fImode\fR option is
232 passed to [\fBtest\fR], the script \fIscript\fR will be evaluated
233 to compare the actual result of evaluating the body of the test
234 to the expected result.
235 To perform the match, the \fIscript\fR is completed with two additional
236 words, the expected result, and the actual result, and the completed script
237 is evaluated in the global namespace.
238 The completed script is expected to return a boolean value indicating
239 whether or not the results match.  The built-in matching modes of
240 [\fBtest\fR] are \fBexact\fR, \fBglob\fR, and \fBregexp\fR.
241 .VE
242 .TP
243 \fBtestConstraint \fIconstraint ?boolean?\fR
244 Sets or returns the boolean value associated with the named \fIconstraint\fR.
245 See \fBTEST CONSTRAINTS\fR below for more information.
246 .TP
247 \fBinterpreter\fR \fI?executableName?\fR
248 Sets or returns the name of the executable to be [\fBexec\fR]ed by
249 [\fBrunAllTests\fR] to run each test file when
250 [\fBconfigure -singleproc\fR] is false.
251 The default value for [\fBinterpreter\fR] is the name of the
252 currently running program as returned by [\fBinfo nameofexecutable\fR].
253 .TP
254 \fBoutputChannel\fR \fI?channelID?\fR
255 Sets or returns the output channel ID.  This defaults to stdout.
256 Any test that prints test related output should send
257 that output to [\fBoutputChannel\fR] rather than letting
258 that output default to stdout.
259 .TP
260 \fBerrorChannel\fR \fI?channelID?\fR
261 Sets or returns the error channel ID.  This defaults to stderr.
262 Any test that prints error messages should send
263 that output to [\fBerrorChannel\fR] rather than printing
264 directly to stderr.
265 .SH "SHORTCUT COMMANDS"
266 .TP
267 \fBdebug \fI?level?\fR
268 Same as [\fBconfigure -debug \fI?level?\fR].
269 .TP
270 \fBerrorFile \fI?filename?\fR
271 Same as [\fBconfigure -errfile \fI?filename?\fR].
272 .TP
273 \fBlimitConstraints \fI?boolean?\fR
274 Same as [\fBconfigure -limitconstraints \fI?boolean?\fR].
275 .TP
276 \fBloadFile \fI?filename?\fR
277 Same as [\fBconfigure -loadfile \fI?filename?\fR].
278 .TP
279 \fBloadScript \fI?script?\fR
280 Same as [\fBconfigure -load \fI?script?\fR].
281 .TP
282 \fBmatch \fI?patternList?\fR
283 Same as [\fBconfigure -match \fI?patternList?\fR].
284 .TP
285 \fBmatchDirectories \fI?patternList?\fR
286 Same as [\fBconfigure -relateddir \fI?patternList?\fR].
287 .TP
288 \fBmatchFiles \fI?patternList?\fR
289 Same as [\fBconfigure -file \fI?patternList?\fR].
290 .TP
291 \fBoutputFile \fI?filename?\fR
292 Same as [\fBconfigure -outfile \fI?filename?\fR].
293 .TP
294 \fBpreserveCore \fI?level?\fR
295 Same as [\fBconfigure -preservecore \fI?level?\fR].
296 .TP
297 \fBsingleProcess \fI?boolean?\fR
298 Same as [\fBconfigure -singleproc \fI?boolean?\fR].
299 .TP
300 \fBskip \fI?patternList?\fR
301 Same as [\fBconfigure -skip \fI?patternList?\fR].
302 .TP
303 \fBskipDirectories \fI?patternList?\fR
304 Same as [\fBconfigure -asidefromdir \fI?patternList?\fR].
305 .TP
306 \fBskipFiles \fI?patternList?\fR
307 Same as [\fBconfigure -notfile \fI?patternList?\fR].
308 .TP
309 \fBtemporaryDirectory \fI?directory?\fR
310 Same as [\fBconfigure -tmpdir \fI?directory?\fR].
311 .TP
312 \fBtestsDirectory \fI?directory?\fR
313 Same as [\fBconfigure -testdir \fI?directory?\fR].
314 .TP
315 \fBverbose \fI?level?\fR
316 Same as [\fBconfigure -verbose \fI?level?\fR].
317 .SH "OTHER COMMANDS"
318 .PP
319 The remaining commands provided by \fBtcltest\fR have better
320 alternatives provided by \fBtcltest\fR or \fBTcl\fR itself.  They
321 are retained to support existing test suites, but should be avoided
322 in new code.
323 .TP
324 \fBtest\fR \fIname description optionList\fR
325 This form of [\fBtest\fR] was provided to enable passing many
326 options spanning several lines to [\fBtest\fR] as a single
327 argument quoted by braces, rather than needing to backslash quote
328 the newlines between arguments to [\fBtest\fR].  The \fIoptionList\fR
329 argument is expected to be a list with an even number of elements
330 representing \fIoption\fR and \fIvalue\fR arguments to pass
331 to [\fBtest\fR].  However, these values are not passed directly, as
332 in the alternate forms of [\fBswitch\fR].  Instead, this form makes
333 an unfortunate attempt to overthrow Tcl's substitution rules by
334 performing substitutions on some of the list elements as an attempt to
335 implement a ``do what I mean'' interpretation of a brace-enclosed
336 ``block''.  The result is nearly impossible to document clearly, and
337 for that reason this form is not recommended.  See the examples in
338 \fBCREATING TEST SUITES WITH TCLTEST\fR below to see that this
339 form is really not necessary to avoid backslash-quoted newlines.
340 If you insist on using this form, examine
341 the source code of \fBtcltest\fR if you want to know the substitution
342 details, or just enclose the third through last argument
343 to [\fBtest\fR] in braces and hope for the best.
344 .TP
345 \fBworkingDirectory\fR \fI?directoryName?\fR
346 Sets or returns the current working directory when the test suite is
347 running.  The default value for workingDirectory is the directory in
348 which the test suite was launched.  The Tcl commands [\fBcd\fR] and
349 [\fBpwd\fR] are sufficient replacements.
350 .TP
351 \fBnormalizeMsg\fR \fImsg\fR
352 Returns the result of removing the ``extra'' newlines from \fImsg\fR,
353 where ``extra'' is rather imprecise.  Tcl offers plenty of string
354 processing commands to modify strings as you wish, and
355 [\fBcustomMatch\fR] allows flexible matching of actual and expected
356 results.
357 .TP
358 \fBnormalizePath\fR \fIpathVar\fR
359 Resolves symlinks in a path, thus creating a path without internal
360 redirection.  It is assumed that \fIpathVar\fR is absolute.
361 \fIpathVar\fR is modified in place.  The Tcl command [\fBfile normalize\fR]
362 is a sufficient replacement.
363 .TP
364 \fBbytestring\fR \fIstring\fR
365 Construct a string that consists of the requested sequence of bytes,
366 as opposed to a string of properly formed UTF-8 characters using the
367 value supplied in \fIstring\fR.  This allows the tester to create
368 denormalized or improperly formed strings to pass to C procedures that
369 are supposed to accept strings with embedded NULL types and confirm
370 that a string result has a certain pattern of bytes.  This is
371 exactly equivalent to the Tcl command [\fBencoding convertfrom identity\fR].
372 .SH TESTS
373 .PP
374 The [\fBtest\fR] command is the heart of the \fBtcltest\fR package.
375 Its essential function is to evaluate a Tcl script and compare
376 the result with an expected result.  The options of [\fBtest\fR]
377 define the test script, the environment in which to evaluate it,
378 the expected result, and how the compare the actual result to
379 the expected result.  Some configuration options of \fBtcltest\fR
380 also influence how [\fBtest\fR] operates.
381 .PP
382 The valid options for [\fBtest\fR] are summarized:
383 .CS
384 .ta 0.8i
385 test \fIname\fR \fIdescription\fR
386         ?-constraints \fIkeywordList|expression\fR?
387         ?-setup \fIsetupScript\fR?
388         ?-body \fItestScript\fR?
389         ?-cleanup \fIcleanupScript\fR?
390         ?-result \fIexpectedAnswer\fR?
391         ?-output \fIexpectedOutput\fR?
392         ?-errorOutput \fIexpectedError\fR?
393         ?-returnCodes \fIcodeList\fR?
394         ?-match \fImode\fR?
395 .CE
396 The \fIname\fR may be any string.  It is conventional to choose
397 a \fIname\fR according to the pattern:
398 .CS
399 \fItarget\fR-\fImajorNum\fR.\fIminorNum\fR
400 .CE
401 For white-box (regression) tests, the target should be the name of the
402 C function or Tcl procedure being tested.  For black-box tests, the
403 target should be the name of the feature being tested.  Some conventions
404 call for the names of black-box tests to have the suffix \fB_bb\fR.
405 Related tests should share a major number.  As a test suite evolves,
406 it is best to have the same test name continue to correspond to the
407 same test, so that it remains meaningful to say things like ``Test
408 foo-1.3 passed in all releases up to 3.4, but began failing in
409 release 3.5.''
410 .PP
411 During evaluation of [\fBtest\fR], the \fIname\fR will be compared
412 to the lists of string matching patterns returned by
413 [\fBconfigure -match\fR], and [\fBconfigure -skip\fR].  The test
414 will be run only if \fIname\fR matches any of the patterns from
415 [\fBconfigure -match\fR] and matches none of the patterns
416 from [\fBconfigure -skip\fR].
417 .PP
418 The \fIdescription\fR should be a short textual description of the
419 test.  The \fIdescription\fR is included in output produced by the
420 test, typically test failure messages.  Good \fIdescription\fR values
421 should briefly explain the purpose of the test to users of a test suite.
422 The name of a Tcl or C function being tested should be included in the
423 description for regression tests.  If the test case exists to reproduce
424 a bug, include the bug ID in the description. 
425 .PP
426 Valid attributes and associated values are:
427 .TP
428 \fB-constraints \fIkeywordList|expression\fR
429 The optional \fB-constraints\fR attribute can be list of one or more
430 keywords or an expression.  If the \fB-constraints\fR value is a list of
431 keywords, each of these keywords should be the name of a constraint
432 defined by a call to [\fBtestConstraint\fR].  If any of the listed
433 constraints is false or does not exist, the test is skipped.  If the
434 \fB-constraints\fR value is an expression, that expression
435 is evaluated. If the expression evaluates to true, then the test is run.
436 Note that the expression form of \fB-constraints\fR may interfere with the
437 operation of [\fBconfigure -constraints\fR] and
438 [\fBconfigure -limitconstraints\fR], and is not recommended.
439 Appropriate constraints should be added to any tests that should
440 not always be run.  That is, conditional evaluation of a test
441 should be accomplished by the \fB-constraints\fR option, not by
442 conditional evaluation of [\fBtest\fR].  In that way, the same
443 number of tests are always reported by the test suite, though
444 the number skipped may change based on the testing environment.
445 The default value is an empty list.  
446 See \fBTEST CONSTRAINTS\fR below for a list of built-in constraints 
447 and information on how to add your own constraints.
448 .TP
449 \fB-setup \fIscript\fR
450 The optional \fB-setup\fR attribute indicates a \fIscript\fR that will be run
451 before the script indicated by the \fB-body\fR attribute.  If evaluation
452 of \fIscript\fR raises an error, the test will fail.  The default value
453 is an empty script.
454 .TP
455 \fB-body \fIscript\fR
456 The \fB-body\fR attribute indicates the \fIscript\fR to run to carry out the 
457 test.  It must return a result that can be checked for correctness.
458 If evaluation of \fIscript\fR raises an error, the test will fail.
459 The default value is an empty script.
460 .TP
461 \fB-cleanup \fIscript\fR
462 The optional \fB-cleanup\fR attribute indicates a \fIscript\fR that will be
463 run after the script indicated by the \fB-body\fR attribute.
464 If evaluation of \fIscript\fR raises an error, the test will fail.
465 The default value is an empty script.
466 .TP
467 \fB-match \fImode\fR
468 The \fB-match\fR attribute determines how expected answers supplied by
469 \fB-result\fR, \fB-output\fR, and \fB-errorOutput\fR are compared.  Valid
470 values for \fImode\fR are \fBregexp\fR, \fBglob\fR, \fBexact\fR, and
471 any value registered by a prior call to [\fBcustomMatch\fR].  The default
472 value is \fBexact\fR.
473 .TP
474 \fB-result \fIexpectedValue\fR
475 The \fB-result\fR attribute supplies the \fIexpectedValue\fR against which
476 the return value from script will be compared. The default value is
477 an empty string.
478 .TP
479 \fB-output \fIexpectedValue\fR
480 The \fB-output\fR attribute supplies the \fIexpectedValue\fR against which
481 any output sent to \fBstdout\fR or [\fBoutputChannel\fR] during evaluation
482 of the script(s) will be compared.  Note that only output printed using
483 [\fBputs\fR] is used for comparison.  If \fB-output\fR is not specified,
484 output sent to \fBstdout\fR and [\fBoutputChannel\fR] is not processed for
485 comparison.
486 .TP
487 \fB-errorOutput \fIexpectedValue\fR
488 The \fB-errorOutput\fR attribute supplies the \fIexpectedValue\fR against
489 which any output sent to \fBstderr\fR or [\fBerrorChannel\fR] during 
490 evaluation of the script(s) will be compared. Note that only output
491 printed using [\fBputs\fR] is used for comparison.  If \fB-errorOutput\fR
492 is not specified, output sent to \fBstderr\fR and [\fBerrorChannel\fR] is
493 not processed for comparison.
494 .TP
495 \fB-returnCodes \fIexpectedCodeList\fR
496 The optional \fB-returnCodes\fR attribute supplies \fIexpectedCodeList\fR,
497 a list of return codes that may be accepted from evaluation of the
498 \fB-body\fR script.  If evaluation of the \fB-body\fR script returns
499 a code not in the \fIexpectedCodeList\fR, the test fails.  All
500 return codes known to [\fBreturn\fR], in both numeric and symbolic
501 form, including extended return codes, are acceptable elements in
502 the \fIexpectedCodeList\fR.  Default value is \fB{ok return}\fR.
503 .PP
504 To pass, a test must successfully evaluate its \fB-setup\fR, \fB-body\fR,
505 and \fB-cleanup\fR scripts.  The return code of the \fB-body\fR script and
506 its result must match expected values, and if specified, output and error
507 data from the test must match expected \fB-output\fR and \fB-errorOutput\fR
508 values.  If any of these conditions are not met, then the test fails.
509 Note that all scripts are evaluated in the context of the caller
510 of [\fBtest\fR].
511 .PP
512 As long as [\fBtest\fR] is called with valid syntax and legal
513 values for all attributes, it will not raise an error.  Test
514 failures are instead reported as output written to [\fBoutputChannel\fR].
515 In default operation, a successful test produces no output.  The output
516 messages produced by [\fBtest\fR] are controlled by the
517 [\fBconfigure -verbose\fR] option as described in \fBCONFIGURABLE OPTIONS\fR
518 below.  Any output produced by the test scripts themselves should be
519 produced using [\fBputs\fR] to [\fBoutputChannel\fR] or
520 [\fBerrorChannel\fR], so that users of the test suite may
521 easily capture output with the [\fBconfigure -outfile\fR] and
522 [\fBconfigure -errfile\fR] options, and so that the \fB-output\fR
523 and \fB-errorOutput\fR attributes work properly.
524 .SH "TEST CONSTRAINTS"
525 .PP
526 Constraints are used to determine whether or not a test should be skipped.
527 Each constraint has a name, which may be any string, and a boolean
528 value.  Each [\fBtest\fR] has a \fB-constraints\fR value which is a
529 list of constraint names.  There are two modes of constraint control.
530 Most frequently, the default mode is used, indicated by a setting
531 of [\fBconfigure -limitconstraints\fR] to false.  The test will run
532 only if all constraints in the list are true-valued.  Thus,
533 the \fB-constraints\fR option of [\fBtest\fR] is a convenient, symbolic
534 way to define any conditions required for the test to be possible or
535 meaningful.  For example, a [\fBtest\fR] with \fB-constraints unix\fR
536 will only be run if the constraint \fBunix\fR is true, which indicates
537 the test suite is being run on a Unix platform.
538 .PP
539 Each [\fBtest\fR] should include whatever \fB-constraints\fR are
540 required to constrain it to run only where appropriate.  Several
541 constraints are pre-defined in the \fBtcltest\fR package, listed
542 below.  The registration of user-defined constraints is performed
543 by the [\fBtestConstraint\fR] command.  User-defined constraints
544 may appear within a test file, or within the script specified
545 by the [\fBconfigure -load\fR] or [\fBconfigure -loadfile\fR]
546 options.
547 .PP
548 The following is a list of constraints pre-defined by the
549 \fBtcltest\fR package itself:
550 .TP
551 \fIsingleTestInterp\fR
552 test can only be run if all test files are sourced into a single interpreter
553 .TP
554 \fIunix\fR
555 test can only be run on any Unix platform
556 .TP
557 \fIwin\fR
558 test can only be run on any Windows platform
559 .TP
560 \fInt\fR
561 test can only be run on any Windows NT platform
562 .TP
563 \fI95\fR
564 test can only be run on any Windows 95 platform
565 .TP
566 \fI98\fR
567 test can only be run on any Windows 98 platform
568 .TP
569 \fImac\fR
570 test can only be run on any Mac platform
571 .TP
572 \fIunixOrWin\fR
573 test can only be run on a Unix or Windows platform
574 .TP
575 \fImacOrWin\fR
576 test can only be run on a Mac or Windows platform
577 .TP
578 \fImacOrUnix\fR
579 test can only be run on a Mac or Unix platform
580 .TP
581 \fItempNotWin\fR
582 test can not be run on Windows.  This flag is used to temporarily
583 disable a test. 
584 .TP
585 \fItempNotMac\fR
586 test can not be run on a Mac.  This flag is used
587 to temporarily disable a test.
588 .TP
589 \fIunixCrash\fR
590 test crashes if it's run on Unix.  This flag is used to temporarily
591 disable a test. 
592 .TP
593 \fIwinCrash\fR
594 test crashes if it's run on Windows.  This flag is used to temporarily
595 disable a test. 
596 .TP
597 \fImacCrash\fR
598 test crashes if it's run on a Mac.  This flag is used to temporarily
599 disable a test. 
600 .TP
601 \fIemptyTest\fR
602 test is empty, and so not worth running, but it remains as a
603 place-holder for a test to be written in the future.  This constraint
604 has value false to cause tests to be skipped unless the user specifies
605 otherwise.
606 .TP
607 \fIknownBug\fR
608 test is known to fail and the bug is not yet fixed.  This constraint
609 has value false to cause tests to be skipped unless the user specifies
610 otherwise.
611 .TP
612 \fInonPortable\fR
613 test can only be run in some known development environment.
614 Some tests are inherently non-portable because they depend on things
615 like word length, file system configuration, window manager, etc.
616 This constraint has value false to cause tests to be skipped unless
617 the user specifies otherwise.  
618 .TP
619 \fIuserInteraction\fR
620 test requires interaction from the user.  This constraint has
621 value false to causes tests to be skipped unless the user specifies
622 otherwise.  
623 .TP
624 \fIinteractive\fR
625 test can only be run in if the interpreter is in interactive mode 
626 (when the global tcl_interactive variable is set to 1).
627 .TP
628 \fInonBlockFiles\fR
629 test can only be run if platform supports setting files into
630 nonblocking mode 
631 .TP
632 \fIasyncPipeClose\fR
633 test can only be run if platform supports async flush and async close
634 on a pipe 
635 .TP
636 \fIunixExecs\fR
637 test can only be run if this machine has Unix-style commands
638 \fBcat\fR, \fBecho\fR, \fBsh\fR, \fBwc\fR, \fBrm\fR, \fBsleep\fR,
639 \fBfgrep\fR, \fBps\fR, \fBchmod\fR, and \fBmkdir\fR available
640 .TP
641 \fIhasIsoLocale\fR
642 test can only be run if can switch to an ISO locale
643 .TP
644 \fIroot\fR
645 test can only run if Unix user is root
646 .TP
647 \fInotRoot\fR
648 test can only run if Unix user is not root
649 .TP
650 \fIeformat\fR
651 test can only run if app has a working version of sprintf with respect
652 to the "e" format of floating-point numbers.
653 .TP
654 \fIstdio\fR
655 test can only be run if [\fBinterpreter\fR] can be [\fBopen\fR]ed
656 as a pipe.
657 .PP
658 The alternative mode of constraint control is enabled by setting
659 [\fBconfigure -limitconstraints\fR] to true.  With that configuration
660 setting, all existing constraints other than those in the constraint
661 list returned by [\fBconfigure -constraints\fR] are set to false.
662 When the value of [\fBconfigure -constraints\fR]
663 is set, all those constraints are set to true.  The effect is that
664 when both options [\fBconfigure -constraints\fR] and
665 [\fBconfigure -limitconstraints\fR] are in use, only those tests including
666 only constraints from the [\fBconfigure -constraints\fR] list
667 are run; all others are skipped.  For example, one might set
668 up a configuration with
669 .CS
670 configure -constraints knownBug \e
671           -limitconstraints true \e
672           -verbose pass
673 .CE
674 to run exactly those tests that exercise known bugs, and discover
675 whether any of them pass, indicating the bug had been fixed.  
676 .SH "RUNNING ALL TESTS"
677 .PP
678 The single command [\fBrunAllTests\fR] is evaluated to run an entire
679 test suite, spanning many files and directories.  The configuration
680 options of \fBtcltest\fR control the precise operations.  The
681 [\fBrunAllTests\fR] command begins by printing a summary of its
682 configuration to [\fBoutputChannel\fR].
683 .PP
684 Test files to be evaluated are sought in the directory
685 [\fBconfigure -testdir\fR].  The list of files in that directory
686 that match any of the patterns in [\fBconfigure -file\fR] and
687 match none of the patterns in [\fBconfigure -notfile\fR] is generated
688 and sorted.  Then each file will be evaluated in turn.  If
689 [\fBconfigure -singleproc\fR] is true, then each file will
690 be [\fBsource\fR]d in the caller's context.  If if is false,
691 then a copy of [\fBinterpreter\fR] will be [\fBexec\fR]d to
692 evaluate each file.  The multi-process operation is useful
693 when testing can cause errors so severe that a process 
694 terminates.  Although such an error may terminate a child
695 process evaluating one file, the master process can continue
696 with the rest of the test suite.  In multi-process operation,
697 the configuration of \fBtcltest\fR in the master process is
698 passed to the child processes as command line arguments,
699 with the exception of [\fBconfigure -outfile\fR].  The
700 [\fBrunAllTests\fR] command in the
701 master process collects all output from the child processes
702 and collates their results into one master report.  Any
703 reports of individual test failures, or messages requested
704 by a [\fBconfigure -verbose\fR] setting are passed directly
705 on to [\fBoutputChannel\fR] by the master process.
706 .PP
707 After evaluating all selected test files, a summary of the
708 results is printed to [\fBoutputChannel\fR].  The summary
709 includes the total number of [\fBtest\fR]s evaluated, broken
710 down into those skipped, those passed, and those failed.
711 The summary also notes the number of files evaluated, and the names
712 of any files with failing tests or errors.  A list of
713 the constraints that caused tests to be skipped, and the
714 number of tests skipped for each is also printed.  Also,
715 messages are printed if it appears that evaluation of
716 a test file has caused any temporary files to be left
717 behind in [\fBconfigure -tmpdir\fR].
718 .PP
719 Having completed and summarized all selected test files,
720 [\fBrunAllTests\fR] then recursively acts on subdirectories
721 of [\fBconfigure -testdir\fR].  All subdirectories that
722 match any of the patterns in [\fBconfigure -relateddir\fR]
723 and do not match any of the patterns in
724 [\fBconfigure -asidefromdir\fR] are examined.  If
725 a file named \fBall.tcl\fR is found in such a directory,
726 it will be [\fBsource\fR]d in the caller's context.
727 Whether or not an examined directory contains an
728 \fBall.tcl\fR file, its subdirectories are also scanned
729 against the [\fBconfigure -relateddir\fR] and
730 [\fBconfigure -asidefromdir\fR] patterns.  In this way,
731 many directories in a directory tree can have all their
732 test files evaluated by a single [\fBrunAllTests\fR]
733 command.
734 .SH "CONFIGURABLE OPTIONS"
735 The [\fBconfigure\fR] command is used to set and query the configurable
736 options of \fBtcltest\fR.  The valid options are:
737 .TP
738 \fB-singleproc \fIboolean\fR
739 Controls whether or not [\fBrunAllTests\fR] spawns a child process for
740 each test file.  No spawning when \fIboolean\fR is true.  Default
741 value is false.
742 .TP
743 \fB-debug \fIlevel\fR
744 Sets the debug level to \fIlevel\fR, an integer value indicating how
745 much debugging information should be printed to stdout.  Note that
746 debug messages always go to stdout, independent of the value of
747 [\fBconfigure -outfile\fR].  Default value is 0.  Levels are defined as:
748 .RS
749 .IP 0
750 Do not display any debug information.
751 .IP 1
752 Display information regarding whether a test is skipped because it
753 doesn't match any of the tests that were specified using by
754 [\fBconfigure -match\fR] (userSpecifiedNonMatch) or matches any of
755 the tests specified by [\fBconfigure -skip\fR] (userSpecifiedSkip).  Also
756 print warnings about possible lack of cleanup or balance in test files.
757 .IP 2
758 Display the flag array parsed by the command line processor, the
759 contents of the ::env array, and all user-defined variables that exist
760 in the current namespace as they are used.
761 .IP 3
762 Display information regarding what individual procs in the test
763 harness are doing.
764 .RE
765 .TP
766 \fB-verbose \fIlevel\fR
767 Sets the type of output verbosity desired to \fIlevel\fR,
768 a list of zero or more of the elements \fBbody\fR, \fBpass\fR,
769 \fBskip\fR, \fBstart\fR, and \fBerror\fR.  Default value is \fBbody\fR.
770 Levels are defined as: 
771 .RS
772 .IP "body (b)"
773 Display the body of failed tests
774 .IP "pass (p)"
775 Print output when a test passes
776 .IP "skip (s)"
777 Print output when a test is skipped
778 .IP "start (t)"
779 Print output whenever a test starts
780 .IP "error (e)"
781 Print errorInfo and errorCode, if they exist, when a test return code
782 does not match its expected return code
783 .RE
784 The single letter abbreviations noted above are also recognized
785 so that [\fBconfigure -verbose pt\fR] is the same as
786 [\fBconfigure -verbose  {pass start}\fR].
787 .TP
788 \fB-preservecore \fIlevel\fR
789 Sets the core preservation level to \fIlevel\fR.  This level
790 determines how stringent checks for core files are.  Default
791 value is 0.  Levels are defined as:
792 .RS
793 .IP 0
794 No checking - do not check for core files at the end of each test
795 command, but do check for them in [\fBrunAllTests\fR] after all
796 test files have been evaluated.
797 .IP 1
798 Also check for core files at the end of each [\fBtest\fR] command.
799 .IP 2
800 Check for core files at all times described above, and save a 
801 copy of each core file produced in [\fBconfigure -tmpdir\fR].
802 .RE
803 .TP
804 \fB-limitconstraints \fIboolean\fR
805 Sets the mode by which [\fBtest\fR] honors constraints as described
806 in \fBTESTS\fR above.  Default value is false.
807 .TP
808 \fB-constraints \fIlist\fR
809 Sets all the constraints in \fIlist\fR to true.  Also used in
810 combination with [\fBconfigure -limitconstraints true\fR] to control an
811 alternative constraint mode as described in \fBTESTS\fR above.
812 Default value is an empty list.
813 .TP
814 \fB-tmpdir \fIdirectory\fR
815 Sets the temporary directory to be used by [\fBmakeFile\fR],
816 [\fBmakeDirectory\fR], [\fBviewFile\fR], [\fBremoveFile\fR], 
817 and [\fBremoveDirectory\fR] as the default directory where
818 temporary files and directories created by test files should
819 be created.  Default value is [\fBworkingDirectory\fR].
820 .TP
821 \fB-testdir \fIdirectory\fR
822 Sets the directory searched by [\fBrunAllTests\fR] for test files
823 and subdirectories.  Default value is [\fBworkingDirectory\fR].
824 .TP
825 \fB-file \fIpatternList\fR
826 Sets the list of patterns used by [\fBrunAllTests\fR] to determine
827 what test files to evaluate.  Default value is \fB*.test\fR.
828 .TP
829 \fB-notfile \fIpatternList\fR
830 Sets the list of patterns used by [\fBrunAllTests\fR] to determine
831 what test files to skip.  Default value is \fBl.*.test\fR, so
832 that any SCCS lock files are skipped.
833 .TP
834 \fB-relateddir \fIpatternList\fR
835 Sets the list of patterns used by [\fBrunAllTests\fR] to determine
836 what subdirectories to search for an \fBall.tcl\fR file.  Default
837 value is \fB*\fR.
838 .TP
839 \fB-asidefromdir \fIpatternList\fR
840 Sets the list of patterns used by [\fBrunAllTests\fR] to determine
841 what subdirectories to skip when searching for an \fBall.tcl\fR file.
842 Default value is an empty list.
843 .TP
844 \fB-match \fIpatternList\fR
845 Set the list of patterns used by [\fBtest\fR] to determine whether
846 a test should be run.  Default value is \fB*\fR.
847 .TP
848 \fB-skip \fIpatternList\fR
849 Set the list of patterns used by [\fBtest\fR] to determine whether
850 a test should be skipped.  Default value is an empty list.
851 .TP
852 \fB-load \fIscript\fR
853 Sets a script to be evaluated by [\fBloadTestedCommands\fR].
854 Default value is an empty script.
855 .TP
856 \fB-loadfile \fIfilename\fR
857 Sets the filename from which to read a script to be evaluated
858 by [\fBloadTestedCommands\fR].  This is an alternative to
859 \fB-load\fR.  They cannot be used together.
860 .TP
861 \fB-outfile \fIfilename\fR 
862 Sets the file to which all output produced by tcltest should be
863 written.  A file named \fIfilename\fR will be [\fBopen\fR]ed for writing,
864 and the resulting channel will be set as the value of [\fBoutputChannel\fR].
865 .TP
866 \fB-errfile \fIfilename\fR
867 Sets the file to which all error output produced by tcltest
868 should be written.  A file named \fIfilename\fR will be [\fBopen\fR]ed
869 for writing, and the resulting channel will be set as the value
870 of [\fBerrorChannel\fR].
871 .SH "CREATING TEST SUITES WITH TCLTEST"
872 .PP
873 The fundamental element of a test suite is the individual [\fBtest\fR]
874 command.  We begin with several examples.
875 .IP [1]
876 Test of a script that returns normally.
877 .CS
878 test example-1.0 {normal return} {
879     format %s value
880 } value
881 .CE
882 .IP [2]
883 Test of a script that requires context setup and cleanup.  Note the
884 bracing and indenting style that avoids any need for line continuation.
885 .CS
886 test example-1.1 {test file existence} -setup {
887     set file [makeFile {} test]
888 } -body {
889     file exists $file
890 } -cleanup {
891     removeFile test
892 } -result 1
893 .CE
894 .IP [3]
895 Test of a script that raises an error.
896 .CS
897 test example-1.2 {error return} -body {
898     error message
899 } -returnCodes error -result message
900 .CE
901 .IP [4]
902 Test with a constraint.
903 .CS
904 test example-1.3 {user owns created files} -constraints {
905     unix
906 } -setup {
907     set file [makeFile {} test]
908 } -body {
909     file attributes $file -owner
910 } -cleanup {
911     removeFile test
912 } -result $::tcl_platform(user)
913 .CE
914 .PP
915 At the next higher layer of organization, several [\fBtest\fR] commands
916 are gathered together into a single test file.  Test files should have
917 names with the \fB.test\fR extension, because that is the default pattern
918 used by [\fBrunAllTests\fR] to find test files.  It is a good rule of
919 thumb to have one test file for each source code file of your project.
920 It is good practice to edit the test file and the source code file
921 together, keeping tests synchronized with code changes.
922 .PP 
923 Most of the code in the test file should be the [\fBtest\fR] commands.
924 Use constraints to skip tests, rather than conditional evaluation
925 of [\fBtest\fR].  That is, do this:
926 .IP [5]
927 .CS
928 testConstraint X [expr $myRequirement]
929 test goodConditionalTest {} X {
930     # body
931 } result
932 .CE
933 and do not do this:
934 .IP [6]
935 .CS
936 if $myRequirement {
937     test badConditionalTest {} {
938         #body
939     } result
940 }
941 .CE
942 .PP
943 Use the \fB-setup\fR and \fB-cleanup\fR options to establish and release
944 all context requirements of the test body.  Do not make tests depend on
945 prior tests in the file.  Those prior tests might be skipped.  If several
946 consecutive tests require the same context, the appropriate setup
947 and cleanup scripts may be stored in variable for passing to each tests
948 \fB-setup\fR and \fB-cleanup\fR options.  This is a better solution than
949 performing setup outside of [\fBtest\fR] commands, because the setup will
950 only be done if necessary, and any errors during setup will be reported,
951 and not cause the test file to abort.
952 .PP
953 A test file should be able to be combined with other test files and not
954 interfere with them, even when [\fBconfigure -singleproc 1\fR] causes
955 all files to be evaluated in a common interpreter.  A simple way to
956 achieve this is to have your tests define all their commands and variables
957 in a namespace that is deleted when the test file evaluation is complete.
958 A good namespace to use is a child namespace \fBtest\fR of the namespace
959 of the module you are testing.
960 .PP
961 A test file should also be able to be evaluated directly as a script,
962 not depending on being called by a master [\fBrunAllTests\fR].  This
963 means that each test file should process command line arguments to give
964 the tester all the configuration control that \fBtcltest\fR provides.
965 .PP
966 After all [\fBtest\fR]s in a test file, the command [\fBcleanupTests\fR]
967 should be called.
968 .IP [7]
969 Here is a sketch of a sample test file illustrating those points:
970 .CS
971 package require tcltest 2.2
972 eval tcltest::configure $argv
973 package require example
974 namespace eval ::example::test {
975     namespace import ::tcltest::*
976     testConstraint X [expr {...}]
977     variable SETUP {#common setup code}
978     variable CLEANUP {#common cleanup code}
979     test example-1 {} -setup $SETUP {
980         # First test
981     } -cleanup $CLEANUP -result {...}
982     test example-2 {} -constraints X -setup $SETUP {
983         # Second test; constrained
984     } -cleanup $CLEANUP -result {...}
985     test example-3 {} {
986         # Third test; no context required
987     } {...}
988     cleanupTests
989 }
990 namespace delete ::example::test
991 .CE
992 .PP
993 The next level of organization is a full test suite, made up of several
994 test files.  One script is used to control the entire suite.  The
995 basic function of this script is to call [\fBrunAllTests\fR] after
996 doing any necessary setup.  This script is usually named \fBall.tcl\fR
997 because that's the default name used by [\fBrunAllTests\fR] when combining
998 multiple test suites into one testing run.
999 .IP [8]
1000 Here is a sketch of a sample test suite master script:
1001 .CS
1002 package require Tcl 8.4
1003 package require tcltest 2.2
1004 package require example
1005 tcltest::configure -testdir \
1006         [file dir [file normalize [info script]]]
1007 eval tcltest::configure $argv
1008 tcltest::runAllTests
1009 .CE
1010 .SH COMPATIBILITY
1011 .PP
1012 A number of commands and variables in the \fB::tcltest\fR namespace
1013 provided by earlier releases of \fBtcltest\fR have not been documented
1014 here.  They are no longer part of the supported public interface of
1015 \fBtcltest\fR and should not be used in new test suites.  However,
1016 to continue to support existing test suites written to the older
1017 interface specifications, many of those deprecated commands and
1018 variables still work as before.  For example, in many circumstances,
1019 [\fBconfigure\fR] will be automatically called shortly after
1020 [\fBpackage require tcltest 2.1\fR] succeeds with arguments
1021 from the variable \fB::argv\fR.  This is to support test suites
1022 that depend on the old behavior that \fBtcltest\fR was automatically
1023 configured from command line arguments.  New test files should not
1024 depend on this, but should explicitly include
1025 .CS
1026 eval tcltest::configure $::argv
1027 .CE
1028 to establish a configuration from command line arguments.
1029 .SH "KNOWN ISSUES"
1030 There are two known issues related to nested evaluations of [\fBtest\fR].  
1031 The first issue relates to the stack level in which test scripts are
1032 executed.  Tests nested within other tests may be executed at the same
1033 stack level as the outermost test.  For example, in the following code: 
1034 .CS
1035 test level-1.1 {level 1} {
1036     -body {
1037         test level-2.1 {level 2} {
1038         }
1039     }
1040 }
1041 .CE
1042 any script executed in level-2.1 may be executed at the same stack
1043 level as the script defined for level-1.1.  
1044 .PP
1045 In addition, while two [\fBtest\fR]s have been run, results will only
1046 be reported by [\fBcleanupTests\fR] for tests at the same level as
1047 test level-1.1.  However, test results for all tests run prior to
1048 level-1.1 will be available when test level-2.1 runs.  What this
1049 means is that if you try to access the test results for test level-2.1,
1050 it will may say that 'm' tests have run, 'n' tests have
1051 been skipped, 'o' tests have passed and 'p' tests have failed,
1052 where 'm', 'n', 'o', and 'p' refer to tests that were run at the
1053 same test level as test level-1.1. 
1054 .PP
1055 Implementation of output and error comparison in the test command
1056 depends on usage of puts in your application code.  Output is
1057 intercepted by redefining the puts command while the defined test
1058 script is being run.  Errors thrown by C procedures or printed
1059 directly from C applications will not be caught by the test command.
1060 Therefore, usage of the \fB-output\fR and \fB-errorOuput\fR
1061 options to [\fBtest\fR] is useful only for pure Tcl applications
1062 that use [\fBputs\fR] to produce output. 
1063
1064 .SH KEYWORDS
1065 test, test harness, test suite