Preprocessors
*************







A preprocessor is used to initialize the test environment. It may activated by a
dependency setup or before a check is done (in that last case, the preprocessor
is called before the check, and called back when the check is done to clean the
environment).

If an error is raised by a preprocessor, the test or the check will be skipped
with an error status.

Each preprocessor support options below to configure on which occasions it will
be launched :

+--------------+-----+---------------------------------------------------------+
|     name     | req |   description                                           |
+==============+=====+=========================================================+
| match_checks | no  | comma separated list of checker names (track checkers)  |
+--------------+-----+---------------------------------------------------------+

test can also define a preprocessors option listing the preprocessors to use
when used as a dependancy


APyCot comes with the following preprocessors. If you don't find the feature
you're  looking for, you may still write your own preprocessor, and contribute
it ;). The best way to do so for the moment is to look at the existant ones...
Some preprocessors depends on a third-party program (usually a Python package or
an external command), so they may be not available according to your system
setup. 


setup_install
`````````````
:depends on: distutils
:description:
  Use a distutils'setup.py script to install a Python package. The setup.py should
  provide an "install" function which run the setup and return a "dist" object
  (i.e. the object return by the distutils.setup function). This preprocessor may
  modify the PATH and PYTHONPATH environment variables.

build_debian
````````````
:depends on: devtools_
:description:
  Use the devtools buildeb module to build debian packages. The upstream package
  should have a "debian" directory containing the debian packages description. The
  generated packages will be in the package upstream directory, allowing to call
  the lintian checker on them.

zope_install
````````````
:depends on: Zope's SOFTWARE_HOME and INSTANCE_HOME
:description:
  Install a Zope product in a Zope test environment (i.e. INSTANCE_HOME), by
  creating a symbolic link of the extracted directory in the instance's Products
  directory. The user running tester must be able to create this link !

make
````
:depends on: make
:description:
  A whatever builder / installer using make. You can configure this preprocessor
  to run make in the desired package subdirectories (if no one provided, make will
  be run at the root of the package).
:options:
  +-------------+-----+--------------------------------------------------------+
  |     name    | req |   description                                          |
  +=============+=====+========================================================+
  | directories | no  | comma separated list of package's directories where    |
  |             |     | make should be run                                     |
  +-------------+-----+--------------------------------------------------------+
  | target      | no  | the target to make                                     |
  +-------------+-----+--------------------------------------------------------+

.. include:: links.txt
