[Perlunit-devel] Re: Test::Unit
Status: Beta
Brought to you by:
mca1001
From: Christian L. <le...@ai...> - 2001-12-04 09:55:31
|
Hi Adam, Thanks for your patch and contributions! Please note that I do not maintain Test::Unit anymore. The new maintainer is Piers Cawley and the other folks on the perlunit.sourceforge.net group - see http://perlunit.sourceforge.net/ . I have copied your mail on to the development mailing list of PerlUnit, as the group effort at sourceforge is called. Please join these mailing lists: per...@li... per...@li... The devel group is much more alive, you should post there. Please join the group effort, if you feel you want to contribute to PerlUnit. The project is in need of people with experience in testing with this software, especially for documentation and contributions of examples of real-life testing scripts. Cheers, Christian Lemburg Adam Monsen <am...@co...> writes: > I'm liking Test::Unit. I've never used JUnit, but now I'll never have to! > (or at least I'll learn JUnit faster whenever I do start coding in Java) > > I've been using Test::Unit::TestCase with excellent results. > Test::Unit::TestRunner is quite handy. I use the following script to run > tests... > > #!/usr/bin/perl -w > use Test::Unit::TestRunner; > use strict; > > chomp(my $script = `basename $0`); > die "Usage: $script <modules>\n" unless @ARGV; > for (@ARGV) { > s/\.pm//g; > my $testrunner = Test::Unit::TestRunner->new(); > $testrunner->start($_); > print "\n"; # make it pretty > } > > I use basename becuase I think it should recognize filenames as well as > modules. The added newline is because TestRunner doesn't print one after > printing out timing information. Here's a patch to fix that... > > *** TestRunner.pm.old Mon Dec 3 13:48:45 2001 > --- TestRunner.pm Mon Dec 3 13:49:19 2001 > *************** > *** 60,66 **** > my $run_time = timediff($end_time, $start_time); > $self->_print("\n", "Time: ", timestr($run_time), "\n"); > > ! $self->print_result($result); > > if ($wait) { > print "<RETURN> to continue"; # go to STDIN any case > --- 60,66 ---- > my $run_time = timediff($end_time, $start_time); > $self->_print("\n", "Time: ", timestr($run_time), "\n"); > > ! $self->print_result($result), print "\n"; > > if ($wait) { > print "<RETURN> to continue"; # go to STDIN any case > > > Here are a few issues/requests/whatever I have with Test::Unit... > 1. Is there any way to order tests? > 2. Is there any way to plan for X number of tests like with Test.pm? > 3. Listing the test names would be cool, this could be a "verbose" option or > something. I usually do something like this: > sub test_email_results { > my $self = shift; > warn +(caller 0)[3]."\n"; > # Test Code Here > } > 4. when an assert fails, it would be nice to know on what line the failure > occurred (could also apply to the "verbose" setting). I do use the second > argument to assert() to add descriptive text, and I guess I could always add > __LINE__ or (caller(0))[2] or something. > 5. I can't get quell_backtrace() to work (ie: a test sub dies, and a > backtrace is given even if $self->quell_backtrace() is called within the > same test sub). Where should I put a call to this method to get it to > actually work? > > I would like to contribute to this package if you want/need any help. It's > interesting, and I'm excited to make good use of it. I have a heightened > sense of awareness about software testing after reading about the Therac-25 > accidents <http://courses.cs.vt.edu/~cs3604/lib/Therac_25/Therac_1.html>, > but I have much to learn about effective testing. > > > Adam Monsen > -- Christian Lemburg le...@ai... |