[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.2 Writing new test cases

The test cases are really just shell scripts. They are suitable for /bin/sh on most machines. The procedure for running these is explained in 10.1 Running the tests. These shell scripts read in some common function definitions (mostly from tests/common/test-common) and then proceed to conduct the tests. This section explains those commands used in the test scripts that are not simply normal shell commands. Normal shell commands like sed and grep are not described.

The best approach for writing new test scripts or just individual new test cases is to first think of some aspect that needs better test coverage, and then to write the test script, basing it on an existing script. To make sure that your new tests are really checking for the right things, you can run them against an existing SCCS implementation other than CSSC.

10.2.1 Testing the Test Suite  How to test the test suite itself
10.2.2 docommand  Run a command, checking its return value and output.
10.2.3 remove  Remove a file if it is present.
10.2.4 success  Declare that a test has passed.
10.2.5 fail  Declare that a test has failed.
10.2.6 echo_nonl  Print a string without a following argument.
10.2.7 miscarry  When a test case cannot be run.
10.2.8 real-thing  Some test scripts need to know which features to expect.
10.2.9 need-prt  Not all implementations have prt



This document was generated by Yann Dirson on January, 27 2005 using texi2html