Re: Counting passed/failed unit tests

2011-10-27 Thread Jacob Carlborg
On 2011-10-26 21:45, Jonathan M Davis wrote: On Wednesday, October 26, 2011 21:28:10 Jacob Carlborg wrote: Well, in my library, if an assert error is thrown in a block (passed to the it method), the whole block is canceled and it will continue with the next block. So it's up to the user how the

Re: Counting passed/failed unit tests

2011-10-27 Thread Jonathan M Davis
On Thursday, October 27, 2011 08:54:12 Jacob Carlborg wrote: On 2011-10-26 21:45, Jonathan M Davis wrote: On Wednesday, October 26, 2011 21:28:10 Jacob Carlborg wrote: Well, in my library, if an assert error is thrown in a block (passed to the it method), the whole block is canceled and

Re: Counting passed/failed unit tests

2011-10-26 Thread David Gileadi
On 10/25/11 4:04 AM, Jacob Carlborg wrote: On 2011-10-24 22:08, Jonathan M Davis wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the first failing unittest though. What is the point of that 'failed' counter? It's a long standing issue that

Re: Counting passed/failed unit tests

2011-10-26 Thread Jonathan M Davis
On Wednesday, October 26, 2011 08:40 David Gileadi wrote: On 10/25/11 4:04 AM, Jacob Carlborg wrote: On 2011-10-24 22:08, Jonathan M Davis wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the first failing unittest though. What is the

Re: Counting passed/failed unit tests

2011-10-26 Thread Jacob Carlborg
On 2011-10-26 17:40, David Gileadi wrote: On 10/25/11 4:04 AM, Jacob Carlborg wrote: On 2011-10-24 22:08, Jonathan M Davis wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the first failing unittest though. What is the point of that 'failed'

Re: Counting passed/failed unit tests

2011-10-26 Thread Jonathan M Davis
On Wednesday, October 26, 2011 21:28:10 Jacob Carlborg wrote: On 2011-10-26 17:40, David Gileadi wrote: On 10/25/11 4:04 AM, Jacob Carlborg wrote: On 2011-10-24 22:08, Jonathan M Davis wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the

Re: Counting passed/failed unit tests

2011-10-26 Thread David Gileadi
On 10/26/11 3:45 PM, Jonathan M Davis wrote: On Wednesday, October 26, 2011 21:28:10 Jacob Carlborg wrote: On 2011-10-26 17:40, David Gileadi wrote: On 10/25/11 4:04 AM, Jacob Carlborg wrote: On 2011-10-24 22:08, Jonathan M Davis wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic

Re: Counting passed/failed unit tests

2011-10-25 Thread Alex Rønne Petersen
On 24-10-2011 20:27, Andrej Mitrovic wrote: Ok I can see why, ModuleInfo.unitTest just returns a pointer to a function that calls all unittests on its own. That's not very flexible. Exactly. I was hoping there would be some obscure workaround, but it doesn't seem like luck is on my side here.

Re: Counting passed/failed unit tests

2011-10-25 Thread Jacob Carlborg
On 2011-10-24 22:08, Jonathan M Davis wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the first failing unittest though. What is the point of that 'failed' counter? It's a long standing issue that when one unit test fails within a module,

Counting passed/failed unit tests

2011-10-24 Thread Alex Rønne Petersen
Hi, Is there any way to count the amount of passed/failed unit tests in a module or a program as a whole? From what I can see, druntime simply invokes a function on each module which triggers all actual tests. If this is all the information that is available, I guess it's impossible, but I'm

Re: Counting passed/failed unit tests

2011-10-24 Thread Justin Whear
core.runtime allows a user-supplied unittest runner. Never used it, but check out http://www.digitalmars.com/d/2.0/phobos/core_runtime.html#moduleUnitTester Justin Alex Rønne Petersen wrote: Hi, Is there any way to count the amount of passed/failed unit tests in a module or a program as

Re: Counting passed/failed unit tests

2011-10-24 Thread Andrej Mitrovic
Boom, working version on Windows: http://codepad.org/cLYFwRin For Linux have a look at core.runtime, in particular the runModuleUnitTests function. I didn't even know we could do this. Pretty neat!

Re: Counting passed/failed unit tests

2011-10-24 Thread Andrej Mitrovic
I'm not sure why it just stops after the first failing unittest though. What is the point of that 'failed' counter?

Re: Counting passed/failed unit tests

2011-10-24 Thread Andrej Mitrovic
Ok I can see why, ModuleInfo.unitTest just returns a pointer to a function that calls all unittests on its own. That's not very flexible.

Re: Counting passed/failed unit tests

2011-10-24 Thread Jonathan M Davis
On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the first failing unittest though. What is the point of that 'failed' counter? It's a long standing issue that when one unit test fails within a module, no more within that module are run (though

Re: Counting passed/failed unit tests

2011-10-24 Thread Martin Nowak
On Mon, 24 Oct 2011 22:08:50 +0200, Jonathan M Davis jmdavisp...@gmx.com wrote: On Monday, October 24, 2011 11:23 Andrej Mitrovic wrote: I'm not sure why it just stops after the first failing unittest though. What is the point of that 'failed' counter? It's a long standing issue that when