www.delorie.com/gnu/docs/greg/greg_14.html   search  
 
Buy GNU books!


Greg testing framework

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

5.2 Files and directories

A Greg test run expects to find files and directories in a certain layout (modeled on that used by DejaGNU) - though it is possible to override this DejaGNU compatibility feature and simply run the tests in a list of files.

The test source directory (normally your current directory) is expected to contain one or more tool directories. Each tool directory should contain one or more test scripts. In fact any file in a tool directory which has a `.scm' extension is assumed to be a Guile test script.

When a normal Greg test run is done, Greg goes through each tool directory in turn and loads each test script in turn.

You may set the Guile variable greg-tools or use the --tool ... command-line option to specify a list of tools directories to use rather than assuming that all subdirectories are tool directories. If you do this, the tools are tested in the order in which they appear in the list rather than the default order (ASCII sorted by name).

You may set the Guile variable greg-files or use the --file ... command-line option to specify a list of file names to use rather than assuming that all `.scm' files in each tool directory are test scripts. If you do this, the files are loaded in the order in which they appear in the list. You may omit the `.scm' extension from filenames and Greg will supply it for you if necessary.

You may set the Guile variable greg-paths to specify a list of test files to be run directly, or simply list the files to be run on the command-line.

Doing this overrides the greg-tools and greg-files variables, and simply runs the files you list in the order you list them.

As a (minor) complication to this simple layout, Greg permits the use of `begin.grg' and `end.grg' scripts in both the main source directory and in each tool directory. These scripts permit you to add any initialisation and cleanup code you want. Typically (for non-embedded testing) you would use a `begin.grg' script to start the application to be tested.

If `begin.grg' exists in the main source directory, it will be loaded before any tools are tested.

If `end.grg' exists in the main source directory, it will be loaded after all the tools are tested.

If `begin.grg' exists in a tool directory, it will be loaded before any test scripts in that directory are loaded.

If `end.grg' exists in a tool directory, it will be loaded after all the test scripts in that directory are loaded.

NB. Even when you use the greg-paths variable to run one or more test files directly, the `begin.grg' and `end.grg' files in your current directory will be loaded.


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

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003