I began writing an automated test suite for GIMP (currently with three tests). 
You can checkout it by issuing the command:

svn co svn://svn.berlios.de/gimp-test/trunk/gimp-tests/valid-output/

And then reading the README there. (also included below).

I think it would be a good idea for GIMP to have some automated tests so we'll 
make sure its behaviour is preserved and no new bugs are introduced.


        Shlomi Fish

This is the GIMP Automated Test Suite (http://gimp-test.berlios.de/).


1. Make sure you have perl 5.8.x installed.

2. Install Bundle::GimpTest from CPAN:


    perl -MCPANPLUS -e 'install Bundle::GimpTest'


    perl -MCPAN -e 'install Bundle::GimpTest'

3. Install libseedserve -


You can compile it as an rpm by running rpm -tb on the tar.gz file. 
Alternatively, you can use ./configure; make; make install.

(If you install it not under /usr/lib or /usr/local/lib, please set the 
LD_LIBRARY_PATH environment variable to point to it, prior to running the

4. Install gimp-2.3 from the CVS. (Make sure its in your PATH) - 
5. Install gimp-perl from the CVS.


6. Checkout the test suite from its subversion repository by issuing 
the following command:

    svn co svn://svn.berlios.de/gimp-test/trunk/gimp-tests/valid-output/

Running the Tests:

cd to the tests directory. Run the command:

    perl Test-Harness.pl

This will start the seed server, and the GIMP and run all the tests. After
it finishes, it waits until the key return is pressed, to allow you to
run additional tests manually. Afterwards, it will report the number of
passes and failures and write a list of the tests that failed to 

Then, it will kill the seed service, and quit from the GIMP.

Adding New Tests:

The test files reside in the gen-scripts/ sub-directory. They have the 
general structure of:

#!/usr/bin/perl -w

use strict;
use warnings;

# This is done to execute the test wrapper.
require GimpTest::Run;

# This function will be modified from script to script.
sub gen_image
    my $img;
    # Generate $img
    return { 'image_id' => $img };

Where in Generate $img you are supposed to generate an image starting from 
nothing. Note that if some of the plug-ins called make use of random numbers,
you should call init_seeds([]), with initiatory seeds.

To run a test (say called foo.pl) run run-script-pl with the path to the 
script and a mode GNU parameter:

    $ perl run-script-pl ./gen-scripts/foo.pl --mode=gen

There are currently three modes:

1. --mode=gen - this generates the image in temp/output-images.

2. --mode=init - this generates an image, creates an initatory image signature
and then deletes the image.

3. --mode=check - this generates an image, calculates its signature, compares
it to the existing one, croaks if there's a mismatch. If everything's OK it 
returns a 0 status to the caller, and deletes the final image.

Note that images starting with "__SKIP-" are ignored by the Test-Harness.pl
script and also considered as such with an ID without the __SKIP-. Thus, one
can use them to do the initial development, and when happy with the results,
rename them to their canonical names.

Shlomi Fish      [EMAIL PROTECTED]
Homepage:        http://www.shlomifish.org/

Knuth is not God! It took him two days to build the Roman Empire.
Gimp-developer mailing list

Reply via email to