Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/tests/README @ 25

Last change on this file since 25 was 25, checked in by landauf, 17 years ago

added tcl to libs

File size: 4.4 KB
Line 
1README -- Tcl test suite design document.
2
3RCS: @(#) $Id: README,v 1.12 2003/04/01 19:17:21 dgp Exp $
4
5Contents:
6---------
7
8    1. Introduction
9    2. Running tests
10    3. Adding tests
11    4. Incompatibilities with prior Tcl versions
12
131. Introduction:
14----------------
15
16This directory contains a set of validation tests for the Tcl commands
17and C Library procedures for Tcl.  Each of the files whose name ends
18in ".test" is intended to fully exercise the functions in the C source
19file that corresponds to the file prefix.  The C functions and/or Tcl
20commands tested by a given file are listed in the first line of the
21file.
22
232. Running tests:
24-----------------
25
26We recommend that you use the "test" target of Tcl's Makefile to run
27the test suite.  From the directory in which you build Tcl, simply
28type "make test".  This will create a special executable named
29tcltest in which the testing scripts will be evaluated.  To create
30the tcltest executable without running the test suite, simple type
31"make tcltest".
32
33All the configuration options of the tcltest package are available
34during a "make test" by defining the TESTFLAGS environment variable.
35For example,if you wish to run only those tests in the file append.test,
36you can type:
37
38        make test TESTFLAGS="-file append.test"
39
40For interactive testing, the Tcl Makefile provides the "runtest" target.
41Type "make runtest" in your build directory, and the tcltest executable
42will be created, if necessary, then it will run interactively.  At the
43command prompt, you may type any Tcl commands.  If you type
44"source ../tests/all.tcl", the test suite will run.  You may use the
45tcltest::configure command to configure the test suite run as an
46alternative to command line options via TESTFLAGS.  You might also
47wish to use the tcltest::testConstraint command to select the constraints
48that govern which tests are run.  See the documentation for the tcltest
49package for details.
50
513. Adding tests:
52----------------
53
54Please see the tcltest man page for more information regarding how to
55write and run tests.
56
57Please note that the all.tcl file will source your new test file if
58the filename matches the tests/*.test pattern (as it should).  The
59names of test files that contain regression (or glass-box) tests
60should correspond to the Tcl or C code file that they are testing.
61For example, the test file for the C file "tclCmdAH.c" is
62"cmdAH.test".  Test files that contain black-box tests may not
63correspond to any Tcl or C code file so they should match the pattern
64"*_bb.test".
65
66Be sure your new test file can be run from any working directory.
67
68Be sure no temporary files are left behind by your test file.
69Use [tcltest::makeFile], [tcltest::removeFile], and [tcltest::cleanupTests]
70properly to be sure of this.
71
72Be sure your tests can run cross-platform in both a build environment
73as well as an installation environment.  If your test file contains
74tests that should not be run in one or more of those cases, please use
75the constraints mechanism to skip those tests.
76
774. Incompatibilities of package tcltest 2.1 with
78   testing machinery of very old versions of Tcl:
79------------------------------------------------
80
811) Global variables such as VERBOSE, TESTS, and testConfig of the
82   old machinery correspond to the [configure -verbose],
83   [configure -match], and [testConstraint] commands of tcltest 2.1,
84   respectively.
85
862) VERBOSE values were longer numeric.  [configure -verbose] values
87   are lists of keywords.
88
893) When you run "make test", the working dir for the test suite is now
90   the one from which you called "make test", rather than the "tests"
91   directory.  This change allows for both unix and windows test
92   suites to be run simultaneously without interference with each
93   other or with existing files.  All tests must now run independently
94   of their working directory.
95
964) The "all" file is now called "all.tcl"
97
985) The "defs" and "defs.tcl" files no longer exist.
99
1006) Instead of creating a doAllTests file in the tests directory, to
101   run all nonPortable tests, just use the "-constraints nonPortable"
102   command line flag.  If you are running interactively, you can run
103   [tcltest::testConstraint nonPortable 1] (after loading the tcltest
104   package).
105
1067) Direct evaluation of the *.test files by the "source" command is no
107   longer recommended.  Instead, "source all.tcl" and use the "-file" and
108   "-notfile" options of tcltest::configure to control which *.test files
109   are evaluated.
Note: See TracBrowser for help on using the repository browser.