Re: C/C++ White-Box Unit Testing and Test::More

2004-06-28 Thread Adrian Howard
On 26 Jun 2004, at 12:51, Fergal Daly wrote: On Fri, Jun 25, 2004 at 10:13:52PM +0100, Adrian Howard wrote: [snip] What xUnit gives you is a little bit more infrastructure to make these sorts of task easier. That's fair enough but that infrastructure is just extra baggage in some cases. True. The

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-26 Thread Fergal Daly
On Fri, Jun 25, 2004 at 02:18:49PM -0500, Andy Lester wrote: > On Fri, Jun 25, 2004 at 04:51:29PM +0100, Fergal Daly ([EMAIL PROTECTED]) wrote: > > > * I never have to type repetitive tests like > > > > > > isa_ok Foo->new(), 'Foo' > > > > > > again because it's handled by a base class that all

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-26 Thread Fergal Daly
On Fri, Jun 25, 2004 at 10:13:52PM +0100, Adrian Howard wrote: > On 25 Jun 2004, at 16:51, Fergal Daly wrote: > [snip] > >NB: I haven't used xUnit style testing so I could be completely off > >the mark > >but some (not all) of these benefits seem to be available in T::M land. > > Just so I'm clea

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-26 Thread Tony Bowden
On Fri, Jun 25, 2004 at 01:07:36PM -0400, Andrew Pimlott wrote: > You are also circumventing the isolation part of the xUnit model, > because you don't get setup/teardown for each test data. Possibly you > don't care about that in this case, but if you did, you wouldn't be able > to do the above,

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 25 Jun 2004, at 16:51, Fergal Daly wrote: [snip] NB: I haven't used xUnit style testing so I could be completely off the mark but some (not all) of these benefits seem to be available in T::M land. Just so I'm clear - I'm /not/ saying any of this is impossible with T::M and friends. That's obv

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 24 Jun 2004, at 19:59, Andrew Pimlott wrote: [snip] - You don't have much control (correct me if I'm wrong) about the order of tests, or the relationship between tests, eg you can't say "if this test fails, skip these others". This is straightforward in Test::More's simple procedural sty

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 25 Jun 2004, at 20:18, Andy Lester wrote: Repetition is good. I feel very strongly that you should be checking your constructor results in every single test, and checked against literals, not variables. I'm not complaining about repetitive tests, and I agree with what you said about testing co

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Nicholas Clark
On Fri, Jun 25, 2004 at 02:18:49PM -0500, Andy Lester wrote: > Tests are all about quantity. I always thought that tests were about malice: "I bet the programmer didn't think of this..." "What happens if I just do this..." "Mmm, I wonder if it covers this corner case?" "Eat pathological data and

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Andy Lester
On Fri, Jun 25, 2004 at 04:51:29PM +0100, Fergal Daly ([EMAIL PROTECTED]) wrote: > > * I never have to type repetitive tests like > > > > isa_ok Foo->new(), 'Foo' > > > > again because it's handled by a base class that all my test classes > > inherit from. Repetition is good. I feel very s

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 24 Jun 2004, at 21:10, Tony Bowden wrote: On Thu, Jun 24, 2004 at 02:59:30PM -0400, Andrew Pimlott wrote: I see this more as a limitation than a feature. It seems to mean that - You need to use the same setup/teardown for all your tests. Those that need different things aren't testing the same

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Andrew Pimlott
Ok, now that I understand what library you're using ... On Fri, Jun 25, 2004 at 04:41:15PM +0100, Tony Bowden wrote: > On Fri, Jun 25, 2004 at 11:10:19AM -0400, Andrew Pimlott wrote: > > I was responding to your suggestion to put all the tests in one method > > if they are just parametrized by dat

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Ovid
--- Andrew Pimlott <[EMAIL PROTECTED]> wrote: > Now I'm confused too. None of the Test::Unit examples I've seen use > "is", they use some form of assert. You were looking at Test::Class code, not Test::Unit code. Cheers, Ovid = Silence is Evilhttp://users.easystreet.com/ovid/phi

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Andrew Pimlott
On Fri, Jun 25, 2004 at 04:41:15PM +0100, Tony Bowden wrote: > On Fri, Jun 25, 2004 at 11:10:19AM -0400, Andrew Pimlott wrote: > > I was responding to your suggestion to put all the tests in one method > > if they are just parametrized by data. How do you suggest writing the > > equivalent of > >

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 25 Jun 2004, at 16:10, Andrew Pimlott wrote: [snip] I thought the "isolation" principle that people were talking about is that before every test, a "setup" method is called, and after every test a "teardown" is called, automatically by the test harness. This seems to require one method == one

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Fergal Daly
On Fri, Jun 25, 2004 at 04:05:09PM +0100, Adrian Howard wrote: > > On 24 Jun 2004, at 20:19, Andrew Pimlott wrote: > > >On Thu, Jun 24, 2004 at 05:08:44PM +0100, Adrian Howard wrote: > >>Where xUnit wins for me are in the normal places where OO is useful > >>(abstraction, reuse, revealing intenti

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Tony Bowden
On Fri, Jun 25, 2004 at 11:10:19AM -0400, Andrew Pimlott wrote: > I thought the "isolation" principle that people were talking about is > that before every test, a "setup" method is called, and after every test > a "teardown" is called, automatically by the test harness. This > seems to require on

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 24 Jun 2004, at 21:41, Ovid wrote: [snip] I also like the thought of inheriting tests, but I know not everyone is fond of this idea. There was a moderately interesting discussion about this on Perlmonks: http://www.perlmonks.org/index.pl?node_id=294571 [snip] Yeah, I meant to contribute to tha

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Andrew Pimlott
On Fri, Jun 25, 2004 at 07:35:26AM +0100, Tony Bowden wrote: > On Thu, Jun 24, 2004 at 07:13:08PM -0400, Andrew Pimlott wrote: > > But (I thought) the idea was that every test needs the same setup. If > > they're all in one method, they won't get that. > > How's that? I thought the "isolation"

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Adrian Howard
On 24 Jun 2004, at 20:19, Andrew Pimlott wrote: On Thu, Jun 24, 2004 at 05:08:44PM +0100, Adrian Howard wrote: Where xUnit wins for me are in the normal places where OO is useful (abstraction, reuse, revealing intention, etc.). Since you've thought about this, and obviously don't believe "it's OO

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Tony Bowden
On Thu, Jun 24, 2004 at 07:13:08PM -0400, Andrew Pimlott wrote: > But (I thought) the idea was that every test needs the same setup. If > they're all in one method, they won't get that. How's that? > Also, if you add lots of tests in a single method, (again as I understand) > they will stop a

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Andrew Pimlott
On Thu, Jun 24, 2004 at 09:10:09PM +0100, Tony Bowden wrote: > On Thu, Jun 24, 2004 at 02:59:30PM -0400, Andrew Pimlott wrote: > > I see this more as a limitation than a feature. It seems to mean that > > - You need to use the same setup/teardown for all your tests. > > Those that need different

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Ovid
--- Tony Bowden <[EMAIL PROTECTED]> wrote: > The big gain for me with Test::Class is inheritable tests. Subclasses > can ensure they still pass all their parent's tests, as well as all of > their own, without me having to copy all the tests, or set up a really > clumsy testing environment. And of c

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Tony Bowden
On Thu, Jun 24, 2004 at 02:59:30PM -0400, Andrew Pimlott wrote: > I see this more as a limitation than a feature. It seems to mean that > - You need to use the same setup/teardown for all your tests. Those that need different things aren't testing the same thing and should move to a different cla

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread chromatic
On Thu, 2004-06-24 at 11:59, Andrew Pimlott wrote: > Every time I hear about xUnit, I figure there must be something other > than "setup and teardown" in its favor. If that's all there is, I'm not > sold. It's the best option for languages that enforce a nominally pure OO style. (During the tec

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Andrew Pimlott
On Thu, Jun 24, 2004 at 05:08:44PM +0100, Adrian Howard wrote: > Where xUnit wins for me are in the normal places where OO is useful > (abstraction, reuse, revealing intention, etc.). Since you've thought about this, and obviously don't believe "it's OO so it's better", I'd be interested in seein

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Andrew Pimlott
On Thu, Jun 24, 2004 at 07:09:40AM +0100, Piers Cawley wrote: > The xUnit style framework does a much better job of enforcing test > isolation than Test::More does I see this more as a limitation than a feature. It seems to mean that - You need to use the same setup/teardown for all your tests.

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-24 Thread Adrian Howard
On 24 Jun 2004, at 07:09, Piers Cawley wrote: [snip] The xUnit style framework does a much better job of enforcing test isolation than Test::More does (but you have to remember that what Test::More thinks of as a test, xUnit thinks of as an assertion to be used *in* a test). To be fair to Test::Mor

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-23 Thread Piers Cawley
Andrew Pimlott <[EMAIL PROTECTED]> writes: > On Wed, Jun 09, 2004 at 08:18:30AM -0700, Ovid wrote: >> As for porting a Test::More style framework, I tried doing that with >> Python and was actually doing well with it, but I was shot down pretty >> quickly. > > Any specific reasons why (is the disc

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-10 Thread Andrew Savige
Ovid wrote: > For white box testing C code, I just use assert(). assert() is ok, but ok() is better. :-) I will prolly roll my own custom ok() macro, so instead of: assert(x==y); I can write: ok(x==y, "test that x equals y"); Writing a lot of tests, I want to be able to easily label each test.

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-09 Thread chromatic
On Tue, 2004-06-08 at 20:18, Andrew Savige wrote: > I am currently using Test::More for my Perl white-box unit tests. > I also need to write some C/C++ white-box unit tests and would like > to use something similar in spirit to Test::More. What if you used Inline::C *and* Test::More? If they're

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-09 Thread Andrew Pimlott
On Wed, Jun 09, 2004 at 08:18:30AM -0700, Ovid wrote: > As for porting a Test::More style framework, I tried doing that with > Python and was actually doing well with it, but I was shot down pretty > quickly. Any specific reasons why (is the discussion archived)? Is there any site that compares t

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-09 Thread Ovid
--- Andrew Savige <[EMAIL PROTECTED]> wrote: > Has anyone ported a Test::More style framework to C/C++ or Java? > How do Perl5/Parrot white-box unit test their C code? For white box testing C code, I just use assert(). As for porting a Test::More style framework, I tried doing that with Python an

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-09 Thread Avram Aelony
Perhaps this will be useful... . -Avram On Jun 8, 2004, at 8:18 PM, Andrew Savige wrote: I am currently using Test::More for my Perl white-box unit tests. I also need to write some C/C++ white-box unit tests and would like to use something similar in spi

C/C++ White-Box Unit Testing and Test::More

2004-06-08 Thread Andrew Savige
I am currently using Test::More for my Perl white-box unit tests. I also need to write some C/C++ white-box unit tests and would like to use something similar in spirit to Test::More. Smalltalk's SUnit-style framework has been ported to many languages (JUnit, cppunit, Test::Unit, Test::Class, ...)