in reply to testing code

Thanks to everyone for their great advice.

I thought I would mention that I'm currently trying some new modules: Test::More and Test::Exception.

I have yet to fully figure out how to run Devel::Cover for my code. Right now, to run my tests I run the command
perl t/runtests.pl <server_name>
That script calls all of my various test scripts. Kind of like Test::Harness, which I should probably switch over to (except I didn't see, at first glance, how to pass in that server name argument.) For some reason, everytime I have run it with Devel Cover, I just get an analysis of the script runtests.pl, not the code that is tested. Any advice would be welcome.

I also discovered this node Autogenerate Test Scripts via post 352687. It is a script that will autogenerate stub test scripts for you. It's great - I'm using it in conjunction with Test::More right now. Oh baby!

Replies are listed 'Best First'.
Re^2: testing code
by adrianh (Chancellor) on May 12, 2004 at 20:26 UTC
    That script calls all of my various test scripts. Kind of like Test::Harness, which I should probably switch over to

    You will also probably find the command line prove utility useful (which you'll find in the newer versions of Test::Harness).

    (except I didn't see, at first glance, how to pass in that server name argument.)

    You could always just use an environment variable. Personally I use the notes facility in Module::Build to store any test configuration information.

    For some reason, everytime I have run it with Devel Cover, I just get an analysis of the script runtests.pl, not the code that is tested. Any advice would be welcome.

    Is the directory containing your test scripts in @INC (which is ignored by default)? Check out the command line options for ways to get around this.