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

Greg testing framework

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

5.4 Command-line usage

`greg' is the executable test driver for Greg. This is a Guile script that you can use to run tests from the command line. The command-line options that you can pass to `greg' are listed below.

`greg' returns an exit code of 1 if any test has an unexpected result; otherwise (if all tests pass or fail as expected) it returns 0 as the exit code.

This is the full set of command line options that `greg' recognizes.

greg --tool tool ...
[ --debug ]
[ --file script ... ]
[ --help ]
[ --objdir path ]
[ --outdir path ]
[ --posix ]
[ --srcdir path ]
[ -v | --verbose ]  [ -V | --version ]
[ files to run ]

--tool tool ...
tool specifies what set of tests to run. It provides a list of subdirectories (each corresponding to a tool) in which test scripts can be found. Initialisation code (including executable tool startup) for each tool may be placed in `begin.grg' in the appropriate tool subdirectory. Cleanup code may be placed in `end.grg'.

For example, including --tool gcc on the `greg' command line runs tests from the gcc subdirectory.

The order in which the tools are tested will be the same as the order in which the tool names occur on the command line.

--file script ...
Specify the names of testsuites to run. By default, `greg' runs all tests for the tool, but you can restrict it to particular testsuites by giving the names of the `.scm' Guile scripts that control them. You do not need to supply the `.scm' file extension - it will be assumed.

testsuite may not include path information; use plain filenames.

The order in which the test scripts are run will be the same as the order in which the script names occur on the command line.

Turns on the expect internal debugging output. Debugging output is displayed as part of the `greg' output, and logged to a file called `tests.dbg'. The extra debugging output does not normally appear on standard output.

Prints out a short summary of the `greg' options, then exits (even if you also specify other options).

--objdir path
Use path as the top directory containing any auxiliary compiled test code. This defaults to `.'. Use this option to locate pre-compiled test code. You can normally prepare any auxiliary files needed with make.

--outdir path
Write output logs in directory path. The default is ., the directory where you start `greg'. This option affects only the log and the debug files `tool.log' and `tool.dbg'.

--srcdir path
Use path as the top directory for test scripts to run. `greg' looks in this directory for any subdirectory whose name matches any toolname (specified with --tool).

By default, `greg' shows only the output of tests that produce unexpected results; that is, tests with status FAIL (unexpected failure), UPASS (unexpected success), or ERROR (a severe error in the test case itself). Specifying --verbose to see output for tests with status PASS (success, as expected) and XFAIL (failure, as expected). It also causes a more detailed summary to be displayed.
Specifying --verbose more than once causes more detail to be displayed.

Prints out the version numbers of Greg, and Guile, then exits without running any tests.

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

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