Guido Flohr > Test-Unit-GTestRunner > Test::Unit::GTestRunner



Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  


Test::Unit::GTestRunner - Unit testing framework helper class


 use Test::Unit::GTestRunner;

 Test::Unit::GTestRunner->new->start ($my_testcase_class);

 Test::Unit::GTestRunner::main ($my_testcase_class);


If you just want to run a unit test (suite), try it like this:

    gtestrunner ""

Try "perldoc gtestrunner" or "man gtestrunner" for more information.

This class is a GUI test runner using the Gimp Toolkit Gtk+ (which is called Gtk2 in Perl). You can use it if you want to integrate the testing framework into your own application.

For a description of the graphical user interface, please see gtestrunner(1).


You will usually invoke it from a runner script like this:

    #! /usr/local/bin/perl -w

    use strict;
    require Test::Unit::GTestRunner;

    Test::Unit::GTestRunner::main (@ARGV) or exit 1;

See Test::Unit::TestRunner (3) for details.

An internationalized version would go like this:

    #!/usr/bin/perl -w

    use strict;

    use Test::Unit::GTestRunner;
    use POSIX;
    use Locale::Messages qw (LC_ALL);

    POSIX::setlocale (LC_ALL, "");

    Test::Unit::GTestRunner::main (@ARGV) or exit (1);



The constructor takes no arguments. It will throw an exception in case of failure.


start [SUITE]...

The method fires up the graphical user interface and will never return.

The optional arguments SUITE can either be the name of a file containing a test suite (see Test::Unit::TestSuite(3pm)), for example "", or the name of a Perl module, for example "Tests::TS_MySuite". Multiple suites passed as arguments to the method are assembled into one virtual top-level suite that is hidden from the display.


main [SUITE]...

If you prefer a functional interface, you can also start a test session with

    Test::Unit::GTestRunner::main ($suite_name);

The optional argument SUITE is interpreted as described above for the method start().


Copyright (C) 2004-2006, Guido Flohr <>, all rights reserved. See the source code for details.

This software is contributed to the Perl community by Imperia (


The package is internationalized with libintl-perl, hence the environment variables "LANGUAGE", "LANG", "LC_MESSAGES", and "LC_ALL" will influence the language in which the GUI and messages are presented.


gtestrunner(1), Test::Unit::TestRunner(3pm), Test::Unit(3pm), Locale::Messages(3pm), perl(1)

syntax highlighting: