简体   繁体   中英

Developing Perl & testing Perl

I found a bug in the Perl module IO::Socket::SSL and I could probably fix it, however, I'm concerned about testing the fix. I downloaded the source package from Debian (as my intend is to produce a Debian package or a patch for that) and looked at the t/ directory. There, I found the test coverage is scarce at best.

So I'd like to ask if there is a well known procedure for testing this code. Is there another test (not in the distribution) with better coverage? Also, I would like to use testing modules not in the core distribution (Test::LeakTrace) for testing. Would that be OK?

A quick CPAN search indicates that IO::Socket::SSL is on CPAN . Furthermore, corelist (http://perldoc.perl.org/corelist.html) as of 5.14.1 doesn't report knowing about it, so it is not distributed with core Perl. So, to your questions.

First, CPAN tells me that Steffen Ullrich is still the author and maintainer of the module and although the documentation states a copyright as of 2005, his latest CPAN release is as of 2011. If you're not using Debian Sid, there is a decent chance that he has fixed your problem but it has not yet been repackaged for Debian. Before you do anything, you should try to get a hold of the latest sources. You can do this by downloading a copy of the tarball from CPAN. (Many modules maintain source control on GitHub and there may be more recent developments than the CPAN tarball, but Steffen has not told us where to find them, so we'll just have to start there.) The full test suite should be in this tarball.

The procedure, which you probably know, is to first build the source:

perl Makefile.PL
make

then running the test suite:

make test

If the tests do not cover what you need, you should update the tests and email Steffen (his email and a website are available on the author's page ). He will likely have ideas for how to best supply a patch with tests.

I believe that CPAN is there and should be used, so if it were up to me, I would say that you should use Test::LeakTrace and specify it as a build dependency. However, Steffen may feel differently, so you should talk with him about it.

Hope that helps! Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM