This document describes how to use the scripts located in the toolbin/tests directory, and conventions for writing new testing scripts.
For other information, see the Ghostscript overview and the documentation related to maintaining Ghostscript.
The test scripts discussed here are written in Python, a language whose implementation is freely available from http://www.python.org. The scripts require Python version 2.1 or later.
On Unix and Linux systems, test scripts written in Python can be executed directly simply by typing their name into the shell, e.g.,
On other systems, it may be necessary to invoke Python explicitly, e.g.,
The test scripts will print information about any failures that occur.
The individual test scripts are named toolbin/tests/check_xxx.py (if they do not run Ghostscript) or toolbin/tests/gscheck_xxx.py (if they do run Ghostscript). Any script with such a name can be run individually, and is also normally run as part of regression testing (described in the next section).
We don't list the individual test scripts here, because any such documentation would inevitably be out of date most of the time. Each of these scripts contains documentation about what it tests: we suggest you read the documentation in the scripts.
We run a nightly regression test to discover any obvious problems caused by code checked in the previous day. Here is a list of the scripts and supporting files that make up the regression test.
Some of Ghostscript's test scripts follow a set of conventions that allow them to be run either stand-alone or as part of a suite; in particular, they can be run as part of the nightly regression test suite. In this section, we provide pointers to documentation on how to write new tests that follow these conventions, since that will make them the most useful.
The test scripts are based on Python's unittest module. We suggest that if you are not familiar with this module, you read the documentation, which is available at http://www.python.org/doc/current/lib/module-unittest.html.
Ghostscript specializes the unittest module by defining subclasses, which all individual tests use in place of those in unittest. These subclasses are defined in toolbin/tests/gstestutils.py.
Since code documentation separate from the code itself is always out of date, we have decided to maintain the primary documentation for writing new tests in gstestutils.py rather than here in a separate document. Please read that file for more information.
Copyright © 2002 artofcode LLC. All rights reserved.
This file is part of AFPL Ghostscript. See the Aladdin Free Public License (the "License") for full details of the terms of using, copying, modifying, and redistributing AFPL Ghostscript.
Ghostscript version 8.00, 21 November 2002