RSS/Atom feed Twitter
Site is read-only, email is disabled

GIMP Automated Test Suite

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

GIMP Automated Test Suite Shlomi Fish 22 Feb 10:24
Shlomi Fish
2005-02-22 10:24:18 UTC (about 19 years ago)

GIMP Automated Test Suite

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.

Regards,

Shlomi Fish

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

SETTING UP ----------

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

2. Install Bundle::GimpTest from CPAN:

http://search.cpan.org/dist/Bundle-GimpTest/

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

Or:

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

3. Install libseedserve -

http://gimp-test.berlios.de/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 tests.)

4. Install gimp-2.3 from the CVS. (Make sure its in your PATH) -
http://developer.gimp.org/cvs.html
5. Install gimp-perl from the CVS.

http://developer.gimp.org/cvs.html

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 failed-report.txt.

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 shlomif@iglu.org.il Homepage: http://www.shlomifish.org/

Knuth is not God! It took him two days to build the Roman Empire.