in reply to Re: Re: Including a Gtk2 app in a Test
in thread Including a Gtk2 app in a Test
sub foo { # original foo.pl code here return "all right"; } foo() unless defined caller(); # call foo() unless require'd
And then in your tests do something like
Update: You'll probably not want everything in the foo() function, just the stuff that's needed to set up the gui.# Test::More style used.... use Test::More tests => 1; require "foo.pl"; is(foo(),"all right","Foo() executed normally")
For instance, the run loop will probably be set up by the test module (but I'm only guessing, I've never used the Gtk test modules).
Update 2:: Actually, most of the above is wrong. It will give you some hints on how to solve your problem, though. I'm going to eat something now.
Joost.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Including a Gtk2 app in a Test
by mutated (Monk) on Apr 26, 2004 at 19:37 UTC |