home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / tests / README < prev    next >
Text File  |  1993-09-08  |  4KB  |  94 lines

  1. Tcl Test Suite
  2. --------------
  3.  
  4. This directory contains a set of validation tests for the Tcl
  5. commands.  Each of the files whose name ends in ".test" is
  6. intended to fully exercise one or a few Tcl commands.  The
  7. commands tested by a given file are listed in the first line
  8. of the file.
  9.  
  10. You can run the tests in two ways:
  11.     (a) type "make test" in the parent directory to this one; this
  12.         will run all of the tests.
  13.     (b) start up tcltest in this directory, then "source" the test
  14.         file (for example, type "source parse.test").  To run all
  15.     of the tests, type "source all".
  16. In either case no output will be generated if all goes well, except
  17. for a listing of the tests..  If there are errors then additional
  18. messages will appear in the format described below.
  19.  
  20. The rest of this file provides additional information on the
  21. features of the testing environment.
  22.  
  23. This approach to testing was designed and initially implemented
  24. by Mary Ann May-Pumphrey of Sun Microsystems.  Many thanks to
  25. her for donating her work back to the public Tcl release.
  26.  
  27. Definitions file:
  28. -----------------
  29.  
  30. The file "defs" defines a collection of procedures and variables
  31. used to run the tests.  It is read in automatically by each of the
  32. .test files if needed, but once it has been read once it will not
  33. be read again by the .test files.  If you change defs while running
  34. tests you'll have to "source" it by hand to load its new contents.
  35.  
  36. Test output:
  37. ------------
  38.  
  39. Normally, output only appears when there are errors.  However, if
  40. the variable VERBOSE is set to 1 then tests will be run in "verbose"
  41. mode and output will be generated for each test regardless of
  42. whether it succeeded or failed.  Test output consists of the
  43. following information:
  44.  
  45.     - the test identifier (which can be used to locate the test code
  46.         in the .test file)
  47.     - a brief description of the test
  48.     - the contents of the test code
  49.     - the actual results produced by the tests
  50.     - a "PASSED" or "FAILED" message
  51.     - the expected results (if the test failed)
  52.  
  53. You can set VERBOSE either interactively (after the defs file has been
  54. read in), or you can change the default value in "defs".
  55.  
  56. Selecting tests for execution:
  57. ------------------------------
  58.  
  59. Normally, all the tests in a file are run whenever the file is
  60. "source"d.  However, you can select a specific set of tests using
  61. the global variable TESTS.  This variable contains a pattern;  any
  62. test whose identifier matches TESTS will be run.  For example,
  63. the following interactive command causes all of the "for" tests in
  64. groups 2 and 4 to be executed:
  65.  
  66.     set TESTS {for-[24]*}
  67.  
  68. TESTS defaults to *, but you can change the default in "defs" if
  69. you wish.
  70.  
  71. Saving keystrokes:
  72. ------------------
  73.  
  74. A convenience procedure named "dotests" is included in file
  75. "defs".  It takes two arguments--the name of the test file (such
  76. as "parse.test"), and a pattern selecting the tests you want to
  77. execute.  It sets TESTS to the second argument, calls "source" on
  78. the file specified in the first argument, and restores TESTS to
  79. its pre-call value at the end.
  80.  
  81. Batch vs. interactive execution:
  82. --------------------------------
  83.  
  84. The tests can be run in either batch or interactive mode.  Batch
  85. mode refers to using I/O redirection from a UNIX shell.  For example,
  86. the following command causes the tests in the file named "parse.test"
  87. to be executed:
  88.  
  89.     tclTest < parse.test > parse.test.results
  90.  
  91. Users who want to execute the tests in this fashion need to first
  92. ensure that the file "defs" has proper values for the global
  93. variables that control the testing environment (VERBOSE and TESTS).
  94.