NAME

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

SYNOPSIS

use Test::Unit::GTestRunner;

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

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

DESCRIPTION

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

gtestrunner "MyTestSuite.pm"

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).

EXAMPLE

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);

CONSTRUCTOR

new

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

METHODS

start SUITE

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

The optional argument SUITE can either be the name of a file containing a test suite (see Test::Unit::TestSuite(3pm)), for example "TS_MySuite.pm", or the name of a Perl module, for example "Tests::TS_MySuite".

FUNCTIONS

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().

AUTHOR

Copyright (C) 2004-2005, Guido Flohr <guido@imperia.net>, all rights reserved. See the source code for details.

This software is contributed to the Perl community by Imperia (http://www.imperia.net/).

ENVIRONMENT

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.

SEE ALSO

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