Go to the first, previous, next, last section, table of contents.


Adding a test case to a test suite

There are two slightly different ways to add a test case. One is to add the test case to an existing directory. The other is to create a new directory to hold your test. The existing test directories represent several styles of testing, all of which are slightly different; examine the directories for the tool of interest to see which (if any) is most suitable.

Adding a GCC test can be very simple: just add the C code to any directory beginning with `gcc.' and it runs on the next `runtest --tool gcc'.

To add a test to GDB, first add any source code you will need to the test directory. Then you can either create a new expect file, or add your test to an existing one (any file with a `.exp' suffix). Creating a new `.exp' file is probably a better idea if the test is significantly different from existing tests. Adding it as a separate file also makes upgrading easier. If the C code has to be already compiled before the test will run, then you'll have to add it to the `Makefile.in' file for that test directory, then run configure and make.

Adding a test by creating a new directory is very similar:

  1. Create the new directory. All subdirectory names begin with the name of the tool to test; e.g. G++ tests might be in a directory called `g++.other'. There can be multiple test directories that start with the same tool name (such as `g++').
  2. Add the new directory name to the `configdirs' definition in the `configure.in' file for the test suite directory. This way when make and configure next run, they include the new directory.
  3. Add the new test case to the directory, as above.
  4. To add support in the new directory for configure and make, you must also create a Makefile.in and a configure.in. See section `What Configure Does' in Cygnus Configure.


Go to the first, previous, next, last section, table of contents.