Re: Best Practice for testing compilation of scripts

2006-03-16 Thread Jeffrey Thalhammer
I just found http://search.cpan.org/dist/Test-Strict, which was written by one of my co-workers. Among other cool things, it has a C function which does the same thing. It still uses backticks and redirection which may not be too portable, but it will suit my needs. Still, a C function seems lik

Re: Best Practice for testing compilation of scripts

2006-03-16 Thread Tels
Moin, On Thursday 16 March 2006 03:49, chromatic wrote: > On Wednesday 15 March 2006 18:43, Geoffrey Young wrote: > > I was suggesting the functionality be added to Test::More as > > compile_ok(), rather than runperl() in some separate CPAN module, as > > it seems to closely parallel use_ok() for

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread chromatic
On Wednesday 15 March 2006 18:43, Geoffrey Young wrote: > I was suggesting the functionality be added to Test::More as compile_ok(), > rather than runperl() in some separate CPAN module, as it seems to closely > parallel use_ok() for modules and would be rather useful on a larger scale. That woul

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread Tyler MacDonald
Geoffrey Young <[EMAIL PROTECTED]> wrote: > I was suggesting the functionality be added to Test::More as compile_ok(), > rather than runperl() in some separate CPAN module, as it seems to closely > parallel use_ok() for modules and would be rather useful on a larger scale. I agree, a well

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread Geoffrey Young
>>> I've long intended to take t/test.pl from the Perl core distribution >>> and wrap >>> up at least its runperl() in a Test:: module. Perhaps that would >>> work for >>> you? >> >> >> compile_ok() ? >> >> --Geoff >> > > It is unclear from Geoff's message above whether he is asserting that >

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread Adam Kennedy
http://search.cpan.org/src/ADAMK/ThreatNet-Bot-AmmoBot-0.10/t/01_compile.t That function should probably be changed to use FindBin instead of updir() calls. Actually, by modern standards I'd consider that a pretty half-assed. Mostly for the fact it's a highly unix usage. If it was doing it

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread Chris Dolan
On Mar 15, 2006, at 2:47 PM, Geoffrey Young wrote: chromatic wrote: On Wednesday 15 March 2006 12:25, Jeffrey Thalhammer wrote: I'm sure I could clean this up by opening a pipe instead of using backticks and output redirection. But even that doesn't smell very good. I've looked around on CPA

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread Tels
Moin, On Wednesday 15 March 2006 21:29, chromatic wrote: > On Wednesday 15 March 2006 12:25, Jeffrey Thalhammer wrote: > > I'm sure I could clean this up by opening a pipe > > instead of using backticks and output redirection. > > But even that doesn't smell very good. I've looked > > around on C

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread Geoffrey Young
chromatic wrote: > On Wednesday 15 March 2006 12:25, Jeffrey Thalhammer wrote: > > >>I'm sure I could clean this up by opening a pipe >>instead of using backticks and output redirection. >>But even that doesn't smell very good. I've looked >>around on CPAN, but I have not yet found a Test:: >>

Best Practice for testing compilation of scripts

2006-03-15 Thread Jeffrey Thalhammer
Putting aside the argument that most logic should be in libraries and not scripts, what is the best practice for writing test cases to verify that your Perl scripts compile? My quick and dirty solution is something like: use Test::More tests => 1; chomp (my $output = `perl -c $script 2>&1`); i

Re: Best Practice for testing compilation of scripts

2006-03-15 Thread chromatic
On Wednesday 15 March 2006 12:25, Jeffrey Thalhammer wrote: > I'm sure I could clean this up by opening a pipe > instead of using backticks and output redirection. > But even that doesn't smell very good. I've looked > around on CPAN, but I have not yet found a Test:: > module that seems appropri