Re: [Perlunit-devel] Teensy PerlUnit suggestion, and a question
Status: Beta
Brought to you by:
mca1001
From: Adam S. <ad...@sp...> - 2002-06-21 11:26:34
|
Matthias Ferber (mf...@hi...) wrote: > I built a script that did something like this for JUnit in Java -- the > part about controlling which test methods get run, that is, not the part > about passing arguments, which may be impossible in Java anyway. I used > colons as a delimiter: > > java TestRunner class1:test1 class2:test2... > > The colon would be awkward in Perl because it's also used in the class > delimiter, but another symbol could work: > > perl TestRunner.pl My::Class1.method1 My::Class2.method2 That's quite nice. > You could extend that to passing arguments, except then you have trouble > if the argument contains a period (or whatever delimiter). > > This isn't a wholly thought out idea yet, but what I like about it versus > passing the method names as arguments is that it can be combined with > passing real arguments. I'm not sure that holds water yet, though, and > the method-names-as-arguments idea has the great advantage of being > intuitive (perhaps except for the --, but that doesn't seem so bad to > me). I'm going to try to come up with more ideas and bat this around a > little more. > > Here's one off the cuff: > > perl TestRunner.pl -switches My::ClassA -m method1 -m method2 My::ClassB > > to test two methods from ClassA and all of ClassB. or perl TestRunner.pl -switches My::ClassA ::method1 ::method2 My::ClassB It all depends on whether we want to allow arguments other than methods. I don't need them myself (yet) but I guess we do want to allow them. The other question is whether switches should apply globally or be allowed as sort of local modifiers for each class, although there's a danger we're thinking too far ahead here. |