Re: gtk2-perl / suggesting adding automated testcases



Hi Guillaume,

Guillaume Cottenceau wrote:

[...]
Yes. Only problem being the time it takes to do exhaustive tests
by hands - probably we should try to sort a sort of auto tests
generator if possible.
I agree - I have been thinking about getting Glade-Perl-Two working
now that we have some widgets to play with and I guess that it could
generate UI tests instead of Gtk2-Perl code but this is still some 
way away though.

[...]
But - well I tried it but it didn't work (latest CVS); I've added
the following at line 22:

        [$USE, "Gtk2::Window"],
            ["new('toplevel')"],
            ["new('topleel')", $EXPECT_ERROR,   "=~ /FATAL: invalid GtkWindowType value topleel/"],

Which gives:

(..)
ok 14
not ok 15
# Test 15 got: '__FAIL' (Gtk2/Test.pm at line 216 fail #3)
#    Expected: '__OK' (Unexpected error returned by Gtk2::Window->new('topleel') was 
'Gtk2::Window->new('topleel') FAILED: FATAL: invalid GtkWindowType value topleel, expecting: toplevel / 
GTK_WINDOW_TOPLEVEL, popup / GTK_WINDOW_POPUP at (eval 31) line 1.
#' which does NOT =~ /FATAL: invalid GtkWindowType value topleel/)
Yes a bug :( The checks for new() didn't work - I am also making some 
changes to allow all sorts of tests to be included and also a way to
store the widgets in a hash of arrays so that you can construct whole
UIs and show them in tests. 
 
Also, Test.pm error reporting would be better if you could
include the original line (or <file.pl> line) in the error
because it won't be always easy to guess which line is th 15th,
and counting on screen would be boring :).
Yes, I agree - do you mean a standard print of the testing array? 
AFAIK the error messages tell you what was being tested but I will check
again - perhaps a print of the current test would be good. I will make 
some changes and commit a new version of Gtk/Test.pm sometime soon as I 
now have CVS write access :)

I will put a file t/000_Gtk2_Test.t with tests and examples.

Until then, if you call 'perl t/testfile.t 1' Gtk2::Test will print the
commands just before they are executed (and before any error messages).

Best regards, Dermot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]