Thread: [htmltmpl] Phalanx and HTML::Template
Brought to you by:
samtregar
From: Gabor S. <ga...@pe...> - 2003-10-17 08:51:18
|
A couple of weeks ago the QA team of perl http://qa.perl.org/ have announce the Phalanx project http://use.perl.org/article.pl?sid=03/09/26/1829237 They picked 100 modules considered the most important CPAN modules so these modules will be the starting test suite of Ponie. For this to be useful they want to increase the test coverage of these modules as much as possible. (See details at http://qa.perl.org/phalanx/ ). The idea is that we want to make sure these modules will be fully functional on Ponie/Parrot as well. Having large test suits of important CPAN modules helps the Ponie/Parrot team find their bugs. As I use it quite a lot, I have volunteered to be the hoplite for HTML::Template.[1] Sam has agreed to take in patches if they are reasonable. Of course this work is not for one person only so I'd appreciate your participation and help as well. As Sam probably won't have too much time to work on this I'll try to make things as simple for him as possible and to ask to implement the patches only once there is a substantial value in them. Current status v2.6 ------------------- There are 57 (actually 60 but the script reports 57) tests. Based on the report of Devel::Cover the tests provide a 67.95% code coverage. My Plans: 1) Start from the documentation and write tests based on the documentation. (but keep the old tests) 2) use Test::More for these new tests. 3) Fix documentation based on your input. 4) Change the code if necessary to make it easier (or possible) to test. To make things clear I appreciate the great job done by Sam with this module and I don't want to take over the module nor want I fork it. (Though if Sam wants I'll be glad to start to maintain it.) I have packaged the changes so far and it is available here: http://www.pti.co.il/download/HTML-Template-2.61_01.tar.gz I have added a couple of tests, the code and the documentation has not been changed. I'd appreciate if you downloaded it and tested it on your system. Warning: This is not an official Sam Tregar release ! I'd also appreciate further input to this work. regards Gabor Szabo [1] Actually I am doing similar work for CGI::Application too. |
From: Sam T. <sa...@tr...> - 2003-10-19 21:07:15
|
On Fri, 17 Oct 2003, Gabor Szabo wrote: > Current status v2.6 > ------------------- > There are 57 (actually 60 but the script reports 57) tests. > Based on the report of Devel::Cover the tests provide a 67.95% code > coverage. That seems pretty low. Is that meant to suggest that 33% of lines of Perl code aren't executed during the test run? Maybe you ran the tests without TEST_SHARED_MEMORY and TEST_FILE_CACHE set? > 1) Start from the documentation and write tests based > on the documentation. (but keep the old tests) Cool. > 2) use Test::More for these new tests. Why? That would add a new dependency for the module. I got enough flak when I started using Test.pm! > 3) Fix documentation based on your input. Cool. > 4) Change the code if necessary to make it easier (or possible) > to test. I'd be surprised if this was necessary. HTML::Template presents a nice black box and it's usually pretty easy to feed it a set of inputs and examine the output. > I have packaged the changes so far and it is available here: > http://www.pti.co.il/download/HTML-Template-2.61_01.tar.gz Could you make this available as a patch with 'diff -Naur'? That would make it easier to evaluate the changes at a glance. -sam |
From: Gabor S. <ga...@pe...> - 2003-10-21 03:49:17
|
On Sun, 19 Oct 2003, Sam Tregar wrote: > On Fri, 17 Oct 2003, Gabor Szabo wrote: > > > Current status v2.6 > > ------------------- > > There are 57 (actually 60 but the script reports 57) tests. > > Based on the report of Devel::Cover the tests provide a 67.95% code > > coverage. > > That seems pretty low. Is that meant to suggest that 33% of lines of > Perl code aren't executed during the test run? Maybe you ran the > tests without TEST_SHARED_MEMORY and TEST_FILE_CACHE set? Yes I ran them without those flags so the actual test should cover more. I should have been more careful. I'll do that later and the adjust the original number. Besides the 67.95% is an average and Devel::Cover is declared to be alpha release. You can download the report from here: http://www.pti.co.il/download/ht-cover.tar.gz It already contains my tests so the average here is 68.3 but I think I'll create various reports and upload them so we can later see the progress. If there is :-) > > 2) use Test::More for these new tests. > > Why? That would add a new dependency for the module. I got enough > flak when I started using Test.pm! That's true and I was a bit worried about it but Test::More is already in 5.8.0 and based on a presentation of Schwern and chromatic I understand that nearly all the important modules already require it so it is quite likely that any user of H:T will already have it in older Perls as well. http://magnonel.guild.net/~schwern/talks/Test_Tutorial/Test-Tutorial.pdf But the reason to use it is that it has so much better facilities to write cleaner tests than Test had. > > 4) Change the code if necessary to make it easier (or possible) > > to test. > > I'd be surprised if this was necessary. HTML::Template presents a > nice black box and it's usually pretty easy to feed it a set of inputs > and examine the output. The part which is difficult to test is to emulate errors. That's what I meant but let's put the above on hold till I get my tests out as I also think that most likely it won't be necessary. > > > I have packaged the changes so far and it is available here: > > http://www.pti.co.il/download/HTML-Template-2.61_01.tar.gz > > Could you make this available as a patch with 'diff -Naur'? That > would make it easier to evaluate the changes at a glance. I will, but I think first I add some more tests. In any case the changes were so far: - the version number in Template.pm - added to Changes - META.yml was automatically added - MANIFEST - added the list of new files - Makefile.PL - prerequisite of Test::More - a couple of new files under t/ and tmpl/ Gabor |
From: Sam T. <sa...@tr...> - 2003-10-20 00:28:31
|
On Mon, 20 Oct 2003, Gabor Szabo wrote: > > > 2) use Test::More for these new tests. > > > > Why? That would add a new dependency for the module. I got enough > > flak when I started using Test.pm! > > That's true and I was a bit worried about it but Test::More is already in > 5.8.0 and based on a presentation of Schwern and chromatic I understand > that nearly all the important modules already require it so it is quite > likely that any user of H:T will already have it in older Perls as well. I don't want to make existing users of HTML::Template install a new module just to upgrade HTML::Template. I did it once when I switched to Test.pm and I got enough trouble from that! > The part which is difficult to test is to emulate errors. That's what I > meant but let's put the above on hold till I get my tests out as I also > think that most likely it won't be necessary. It's not difficult to test for errors. Just feed a bad template and trap the die() with eval{}. > - a couple of new files under t/ and tmpl/ Can we have a t/ and still use the existing test.pl? I have a dim memory that the two are exclusive... -sam |