Next: Gtk2::TextAttributes | Previous: Gtk2::TearoffMenuItem | [Gtk2-Perl - Table of Contents] | [Gtk2-Perl - Index] |
Gtk2::TestHelper - Code to make testing Gtk2 and friends simpler.
use Gtk2::TestHelper tests => 10;
A simplistic module that brings together code that would otherwise have to be copied into each and every test. The magic happens during the importing process and therefore all options are passed to the use call. The module also use's strict, warnings, Gtk2, and Test::More so that the individual tests will not have to. The only required option is the number of tests. The module installs a key snooper that causes all keyboard input to be ignored.
This module also defines a few utility functions for use in tests; since we already override import and pull the dirty trick of calling use in the package main, these are defined in the package main rather than exported by Exporter.
If the optional CODEREF is supplied, it will be run right before killing the mainloop. The function is prototyped to allow two styles of invocation:
run_main (\&some_sub); # explicit code reference run_main { print "hi" }; # callback as a block
run_main
and other special trickery.
perl(1), Gtk2(3pm).
The Gtk2-Perl Team.
Copyright 2003-2005 by the gtk2-perl team.
LGPL, See LICENSE file for more information.