Re: passing arguments to tests

2003-09-15 Thread Andrew Savige
Ovid wrote: > --shuffle will shuffle the order in which the tests are run to ensure that > you have no accidental dependency on test order. > > --fast sets and environment variable that can be checked in the test scripts. > For example, if you have a couple of tests that double the time of your tes

Re: passing arguments to tests

2003-09-14 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Moin, On Sunday 14 September 2003 07:37, Andrew Savige wrote: > Ovid wrote: [snip] > functionality seems to be superseded by Apache::TestHarness run() method. > ObDisclaimer: I haven't got a clue what you are talking about, but this bit caught my attention: >

Re: passing arguments to tests

2003-09-13 Thread Andrew Savige
Ovid wrote: > I've just made it available at > http://users.easystreet.com/ovid/cgi_course/downloads/grind.gz > > It needs more work, including allowing descending into directories (via > File::Find or a similar mechanism) and having pre and post actions. > I haven't figured out the best way to do

Re: passing arguments to tests

2003-09-13 Thread Jim Cromie
5.8.1 recently started failing 2 tests in op/cproto.t, on pop(), shift(); this only happens on one box, ie RH-7.2, not RH-9, and I havent tried a make distclean, so I havent reported it to p5p. Instead I decided that some false laziness was in order, and I should go digging. But, I thought it wo

Re: passing arguments to tests

2003-09-13 Thread Adrian Howard
On Thursday, Sep 11, 2003, at 16:38 Europe/London, Ovid wrote: --- Andrew Savige <[EMAIL PROTECTED]> wrote: Oh, that 'grind' looks like a very handy command but I'm a bit confused about how you use it. Is it just a handy general-purpose command or do you use it specifically as part of "make te

Re: passing arguments to tests

2003-09-11 Thread Ovid
--- Andrew Savige <[EMAIL PROTECTED]> wrote: > Oh, that 'grind' looks like a very handy command but I'm a bit > confused about how you use it. Is it just a handy general-purpose > command or do you use it specifically as part of "make test" in > your CPAN distributions? It's a utility that I w

Re: passing arguments to tests

2003-09-11 Thread Andrew Savige
Ovid wrote: > I do something like the following to get this effect: > > #!/usr/bin/perl -w > use strict; > use Test::Harness; > use Getopt::Long; > use Pod::Usage; > > GetOptions( > 'help|?'=> sub { pod2usage(-verbose => 2); exit }, > 'verbose!' => \$Test::Harness::verbos

Re: passing arguments to tests

2003-09-08 Thread Ovid
--- Andrew Savige <[EMAIL PROTECTED]> wrote: > Fergal Daly wrote on 14 July 2003: > > is it possible with Test::Harness and MakeMaker to pass arguments to > > my test scripts? I think it's not but I just want to check for sure. > > The module I'm working on is getting a new "optimised" mode so I'

Re: passing arguments to tests

2003-09-07 Thread Andrew Savige
Fergal Daly wrote on 14 July 2003: > is it possible with Test::Harness and MakeMaker to pass arguments to > my test scripts? I think it's not but I just want to check for sure. > The module I'm working on is getting a new "optimised" mode so I'd like > to be able to run all the tests twice, once

Re: passing arguments to tests

2003-08-20 Thread Michael G Schwern
On Wed, Aug 20, 2003 at 10:34:33PM +1000, Andrew Savige wrote: > Not to mention Semi::Semicolons. I blame Ziggy for that one. > You'll have to take my word for it when I claim that I finally realised > why you'd chosen "Straps" ... right after I pressed the send button. > Maybe after that "is my

Re: Passing arguments to tests

2003-08-20 Thread Andrew Savige
A moron once wrote: > I have a similar problem; I'd like some of my test programs > to generate other test programs on the fly, then run them. > > This seems to work: > > use strict; > use Test::Harness; > my $outf = 'out.tmp'; > print "1..1\n"; > local *SAVOUT; open(SAVOUT, ">&STDOUT"); # save or

Re: passing arguments to tests

2003-08-20 Thread Andrew Savige
Michael G Schwern wrote: > On Wed, Aug 20, 2003 at 07:18:54PM +1000, Andrew Savige wrote: > > I admit to asking my original question as a joke since, as of Perl > 5.6.1, > > Test::Harness was pure functional (Test::Harness::Straps no there). > > However, I am not joking now when I say I have no ide

Re: passing arguments to tests

2003-08-20 Thread Michael G Schwern
On Wed, Aug 20, 2003 at 07:18:54PM +1000, Andrew Savige wrote: > I admit to asking my original question as a joke since, as of Perl 5.6.1, > Test::Harness was pure functional (Test::Harness::Straps no there). > However, I am not joking now when I say I have no idea what "Straps" > means. harness

Re: passing arguments to tests

2003-08-20 Thread Andrew Savige
Michael G Schwern wrote: > On Thu, Jul 24, 2003 at 10:55:57AM +1000, Andrew Savige wrote: >> I'd be interested to see an example of sub-classing Test::Harness. > > See examples/mini_harness.plx in Test::Harness. > > The straps interface is not yet entirely usable. Thanks. Looks interesting. I ad

Re: passing arguments to tests

2003-08-20 Thread Michael G Schwern
On Thu, Jul 24, 2003 at 10:55:57AM +1000, Andrew Savige wrote: > I'd be interested to see an example of sub-classing Test::Harness. See examples/mini_harness.plx in Test::Harness. The straps interface is not yet entirely usable. -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.c

Re: passing arguments to tests

2003-07-29 Thread Tony Bowden
On Thu, Jul 24, 2003 at 09:17:02AM -0400, Potozniak, Andrew wrote: > &Test::More::is(1,1,"One equals One!!"); > &Test::More::is(1,2,"Does one equal two??"); You probably don't want to be calling those with the & in front of them either as that'll make them bypass the prototype. And as the Test fu

RE: passing arguments to tests

2003-07-28 Thread Nick Ing-Simmons
Andrew Potozniak <[EMAIL PROTECTED]> writes: >>I'm afraid your code won't work. > >As stated below I got it to work with my example :-p > >>Okay, you've subclassed a functional module. But this means that >>you'll be >passing the package name as the first argument, not a test >>name. This will

Re: passing arguments to tests

2003-07-25 Thread Andrew Savige
> #!/usr/bin/perl > use strict; > use warnings; > > sub my_fn { print "in sub my_fn, args='@_'\n" } > > # This happily calls my_fn(): the parameters received by my_fn are > # 'sample.t' and 'def'. But why? > > 'sample.t'->main::my_fn('def'); > > # ... yet this fails with: Can't call method "mai

Re: passing arguments to tests

2003-07-24 Thread Andrew Savige
Andrew P's test program does indeed "work" with Perl 5.8.0 on both Unix and Windows with a test name of 'sample.t' in THDriver.pl, yet changing it to './sample.t' results in a failure of: Can't call method "SUPER::runtests" without a package or object reference. But why? The snippet below (tested

RE: passing arguments to tests

2003-07-24 Thread Potozniak, Andrew
-Original Message- From: chromatic [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 12:56 PM To: Potozniak, Andrew Cc: '[EMAIL PROTECTED]' Subject: Re: passing arguments to tests On Thursday, July 24, 2003, at 09:46 AM, Potozniak, Andrew wrote: >> Correct me

Re: passing arguments to tests

2003-07-24 Thread chromatic
On Thursday, July 24, 2003, at 09:46 AM, Potozniak, Andrew wrote: Correct me if I'm wrong but calling $self->SUPER::somesub calls a sub in the functional context which will not pass the "calling class" along with it. Okay, you're wrong. :) 'SUPER::' is just a hint to the method dispatcher to m

RE: passing arguments to tests

2003-07-24 Thread Potozniak, Andrew
>I'm afraid your code won't work. As stated below I got it to work with my example :-p >Okay, you've subclassed a functional module. But this means that >you'll be >passing the package name as the first argument, not a test >name. This will generate a "this >test does not exist" warning with

RE: passing arguments to tests

2003-07-24 Thread Ovid
I'm afraid your code won't work. > package TestHarnessSubClass; [snip] > #This creates TestHarnessSubClass into a sub class of Test::Harness > use base "Test::Harness"; [snip] > sub runtests{ > my $self = shift; [snip] > $self->SUPER::runtests(@_); > } Okay, you've subclassed a functional mo

RE: passing arguments to tests

2003-07-24 Thread Potozniak, Andrew
iak Administrative Computing Student Assistant State University of New York at Buffalo [EMAIL PROTECTED] 645-3587 x 7123 --- -Original Message- From: Andrew Savige [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 8:56 PM To: Po

Re: passing arguments to tests

2003-07-23 Thread Andrew Savige
"Potozniak, Andrew" wrote: > Create a sub class of Test::Harness and or MakeMaker that will over-ride > all of their methods/subroutines and then add what you want it to do, > don't forget to call super classes' method/subroutine that you are > over-riding. I can give an example of this if need be.

RE: passing arguments to tests

2003-07-23 Thread Potozniak, Andrew
>>Fergal Daly wrote: >> Hi, >> is it possible with Test::Harness and MakeMaker to pass arguments >> to my test scripts? I think it's not but I just want to check for sure. >> The module I'm working on is getting a new "optimised" mode so I'd like >> to be able to run all the tests twice, once

Re: passing arguments to tests

2003-07-23 Thread Andrew Savige
Fergal Daly wrote: > Hi, > is it possible with Test::Harness and MakeMaker to pass arguments > to my test scripts? I think it's not but I just want to check for sure. > The module I'm working on is getting a new "optimised" mode so I'd like > to be able to run all the tests twice, once with

Re: passing arguments to tests

2003-07-14 Thread Danny Faught
What's wrong with creating these as subtests within a single .t file? Are you trying to avoid that? Have you looked at Test::Cmd? If I remember right, it's geared for testing command-line applications rather than modules. FWIW, the black box test harness I used to use allowed specifying an ar

Re: passing arguments to tests

2003-07-13 Thread Paul Johnson
On Sun, Jul 13, 2003 at 04:13:07PM +0100, Fergal Daly wrote: > On Sunday 13 July 2003 15:53, Paul Johnson wrote: > > The way I deal with this is to make a module that does all the heavy > > lifting, give it an appropriate import sub, and then a test reduces to > > something like: > > > > use Tes

Re: passing arguments to tests

2003-07-13 Thread Fergal Daly
On Sunday 13 July 2003 15:53, Paul Johnson wrote: > The way I deal with this is to make a module that does all the heavy > lifting, give it an appropriate import sub, and then a test reduces to > something like: > > use TestX ( opt1 => "x", opt2 => "y" ) > > That covers everything except the pe

Re: passing arguments to tests

2003-07-13 Thread Paul Johnson
On Sun, Jul 13, 2003 at 03:22:43PM +0100, Fergal Daly wrote: > Hi, > is it possible with Test::Harness and MakeMaker to pass arguments to my test > scripts? I think it's not but I just want to check for sure. The module I'm > working on is getting a new "optimised" mode so I'd like to be able to ru

passing arguments to tests

2003-07-13 Thread Fergal Daly
Hi, is it possible with Test::Harness and MakeMaker to pass arguments to my test scripts? I think it's not but I just want to check for sure. The module I'm working on is getting a new "optimised" mode so I'd like to be able to run all the tests twice, once with and once without the opti