Re: Counting tests

2009-03-13 Thread Eric Wilhelm
# from Michael G Schwern # on Friday 13 March 2009 22:57: >The audio from the meeting should show up here shortly. >http://pdxpm.podasp.com/archive.html Well, now that you've gone and promised it, I guess I'll have to get that uploaded 'shortly'. Looks like maybe another 30min at the current t

Re: Test::Most, end blocks and TAP

2009-03-13 Thread Michael G Schwern
Fergal Daly wrote: > [oops sending to the list this time] > > 2009/3/13 Ovid : >> >> From: Josh Heumann >> >>> In that case, the way to generate well-formed TAP seems to be to put the >>> END block above the use statement, which either means an end statement >>> a

Re: Counting tests

2009-03-13 Thread Michael G Schwern
Let's sum up. The "why can't a program count its own tests" page refers to the problem of counting the tests *without* running the code. `use Test::More "no_plan";` is the most used way to run a test without having to hard code the number of tests beforehand. The test numbering exists to ensure

Re: Counting tests

2009-03-13 Thread Josh Heumann
> If you still want to calculate a plan on the fly: > > use Test::More 'defer_plan'; > # run tests > all_done($number_of_tests); Just a note so as not to confuse Evgeny: Ovid meant to toot his own horn, and that first line of code should have been: use Test::Most 'defer_plan'; J

Re: Counting tests

2009-03-13 Thread Fergal Daly
2009/3/13 Evgeny : > I actually put a link to the FAQ at the very first mail I sent.It does not > address my questions, it gives examples that say "we can't count tests ahead > of time, its impossible". But I just want you to change the approach from > "ahead of time" into "realtime" or something .

Re: Counting tests

2009-03-13 Thread Evgeny
Gabor, Since you are in the field of testing - then you probably know about the other frameworks in other languages. Specifically what Ruby's Cucumber is about. I tried writing something similar in Perl, using Test::More no less. But I believe you are a far better perl programmer than me, and I wo

Re: Counting tests

2009-03-13 Thread Evgeny
I actually put a link to the FAQ at the very first mail I sent.It does not address my questions, it gives examples that say "we can't count tests ahead of time, its impossible". But I just want you to change the approach from "ahead of time" into "realtime" or something ... like all the other testi

Re: Counting tests

2009-03-13 Thread Evgeny
Hmm... to know that everything is ok? :)If someone put an "exit" in the middle of the code, then yes - it's a problem in perl, since you cant make Test::More catch that exit and replace it with "print test results and then exit". But other than that, if errors occur and the code runs "die" in the

Re: Counting tests

2009-03-13 Thread Evgeny
I actually said "in other languages", like Ruby Test::Unit, or RSpec (also Ruby). And out of all the xUnit frameworks, like JUnit, there is no "specify amount of tests" in any of them. They just count them as you go, and display the total amount of passed/failed/totals at the end. I am not too fami

Re: Counting tests

2009-03-13 Thread Evgeny
If my script ended early, because maybe even a core dump ... the I wont care. It's just another case of a failed test that cant be reported by Test::More, but a human looking at the screen will hopefully understand what happened. On Fri, Mar 13, 2009 at 2:34 PM, Gabor Szabo wrote: > On Fri, Mar

Re: Test::Most, end blocks and TAP

2009-03-13 Thread Fergal Daly
[oops sending to the list this time] 2009/3/13 Ovid : > > > From: Josh Heumann > >> In that case, the way to generate well-formed TAP seems to be to put the >> END block above the use statement, which either means an end statement >> at the top in the section of t

Re: Test::Most, end blocks and TAP

2009-03-13 Thread Ovid
From: Josh Heumann > In that case, the way to generate well-formed TAP seems to be to put the > END block above the use statement, which either means an end statement > at the top in the section of the code with the use statements, or to put > the use statement l

Test::Most, end blocks and TAP

2009-03-13 Thread Josh Heumann
I've been using Test::Most at work for it's handy-dandy defer_plan option, but noticed an interesting situation. This code: use Test::Most qw/ defer_plan /; pass(); END { pass(); } all_done( 2 ); Produces this output: defer_plan ok 1 1..2 ok 2

Re: Counting tests

2009-03-13 Thread Evgeny
Oh, then maybe the 'defer_plan' is actually what I wanted to do all along. That might fit perfectly into my acceptance testing scenario tool. Since I really don't know how many scenarios the "user" of the tool is going to write, so I can't really specify a fixed amount of tests. But I DO want to co

Re: Counting tests

2009-03-13 Thread Ovid
From: Evgeny > I actually put a link to the FAQ at the very first mail I sent. Oh, that's embarrassing :) > It does not address my questions, it gives examples that say > "we can't count tests ahead of time, its impossible". But I > just want you to change the a

Re: Counting tests

2009-03-13 Thread Gabor Szabo
On Fri, Mar 13, 2009 at 2:53 PM, Evgeny wrote: > I actually put a link to the FAQ at the very first mail I sent. > It does not address my questions, it gives examples that say "we can't count > tests ahead of time, its impossible". But I just want you to change the > approach from "ahead of time"

Re: Counting tests

2009-03-13 Thread Gabor Szabo
On Fri, Mar 13, 2009 at 2:45 PM, Evgeny wrote: > Gabor, > Since you are in the field of testing - then you probably know about the > other frameworks in other languages. Specifically what Ruby's Cucumber is > about. > I tried writing something similar in Perl, using Test::More no less. But I > bel

Re: Counting tests

2009-03-13 Thread Ovid
- Original Message > From: Gabor Szabo > On Fri, Mar 13, 2009 at 2:40 PM, Evgeny wrote: > > If my script ended early, because maybe even a core dump ... the I wont > > care. It's just another case of a failed test that cant be reported by > > Test::More, but a human looking at the scre

Re: Counting tests

2009-03-13 Thread Gabor Szabo
On Fri, Mar 13, 2009 at 2:40 PM, Evgeny wrote: > If my script ended early, because maybe even a core dump ... the I wont > care. It's just another case of a failed test that cant be reported by > Test::More, but a human looking at the screen will hopefully understand what > happened. Human? Why

Re: Counting tests

2009-03-13 Thread Gabor Szabo
On Fri, Mar 13, 2009 at 2:04 PM, Evgeny wrote: > I have seen the page : > http://perl-qa.hexten.net/wiki/index.php/Why_can%27t_a_program_count_its_own_tests > > And I still don't understand, why can't a perl program count its test and > then when all the tests are done write something like: > > I

Counting tests

2009-03-13 Thread Evgeny
I have seen the page : http://perl-qa.hexten.net/wiki/index.php/Why_can%27t_a_program_count_its_own_tests And I still don't understand, why can't a perl program count its test and then when all the tests are done write something like: I ran 45976347563873456 tests and 587643873645 of then failed