Thread overview
DUnit beta released
Mar 12, 2008
Christopher Wright
Mar 12, 2008
BCS
Mar 13, 2008
Derek Parnell
Mar 13, 2008
DBloke
Mar 13, 2008
Christopher Wright
Mar 14, 2008
Bill Baxter
March 12, 2008
Hello all,

I'm pleased to announce the release of DUnit 0.1, a unittest framework in the xUnit pattern for D.

Why use DUnit rather than unittest{} blocks?

Have you found yourself writing "Stdout(`test for foo\n`);" at the start of every unit test? Or maybe you have a template for it already.

When one test fails, do you immediately comment it out to see whether any other tests fail to find what the problem is?

Do you find yourself copying and pasting setup code between tests regularly?

Have you spent time searching for a failed test because your tests are interleaved with your code?

If so, DUnit can offer you:
 * organization
 * named tests and fixtures
 * the guiding principle that the testing must go on! (Segfaults notwithstanding.)

DUnit should be usable at present, though I have no idea how usable. Be brave, try it. It *probably* won't summon Cthulhu, or even seriously maim anyone you know!

wiki:
http://www.dsource.org/projects/dmocks/wiki/DUnit
download:
http://www.dsource.org/projects/dmocks/browser/downloads/dunit.1.zip?format=raw

Don't be like the twenty-third elephant on the moon -- get yours today!
March 12, 2008
Reply to Christopher,

> Be brave, try it. It *probably* won't summon Cthulhu, or even
> seriously maim anyone you know!
> 

that should be "Codethulhu" right?

http://thedailywtf.com/Articles/The_Call_of_Codethulhu.aspx


March 13, 2008
On Tue, 11 Mar 2008 21:21:29 -0400, Christopher Wright wrote:

> Hello all,
> 
> I'm pleased to announce the release of DUnit 0.1, a unittest framework in the xUnit pattern for D.

I'm not putting this idea down, so please don't take my comments that way.
I am just letting you know that this solution of yours is not solving any
problem that I have :-)

> Why use DUnit rather than unittest{} blocks?
> 
> Have you found yourself writing "Stdout(`test for foo\n`);" at the start of every unit test? Or maybe you have a template for it already.

No. I haven't needed to do that. As all unittest blocks get run, I have not seen the need to know which ones are run, what order they are run in, or what was the one that failed - as that is displayed by the assert() call anyway.

> When one test fails, do you immediately comment it out to see whether any other tests fail to find what the problem is?

No. I fix the problem that caused the failure and then restart the testing process.

> Do you find yourself copying and pasting setup code between tests regularly?

No. Each test tends to be pretty unique to the situation.

> Have you spent time searching for a failed test because your tests are interleaved with your code?

Never. The assert() tells me exactly which line failed.

> If so, DUnit can offer you:
>   * organization

I have that already.

>   * named tests and fixtures

Don't need this.

>   * the guiding principle that the testing must go on! (Segfaults
> notwithstanding.)

Of course they must. But why comment out a failing test as it probably means that subsequent ones are also going to fail.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
13/03/2008 1:05:15 PM
March 13, 2008
Christopher Wright wrote:
> Hello all,
> 
> I'm pleased to announce the release of DUnit 0.1, a unittest framework in the xUnit pattern for D.
> 
> Why use DUnit rather than unittest{} blocks?
> 
> Have you found yourself writing "Stdout(`test for foo\n`);" at the start of every unit test? Or maybe you have a template for it already.
> 
> When one test fails, do you immediately comment it out to see whether any other tests fail to find what the problem is?
> 
> Do you find yourself copying and pasting setup code between tests regularly?
> 
> Have you spent time searching for a failed test because your tests are interleaved with your code?
> 
> If so, DUnit can offer you:
>  * organization
>  * named tests and fixtures
>  * the guiding principle that the testing must go on! (Segfaults notwithstanding.)
> 
> DUnit should be usable at present, though I have no idea how usable. Be brave, try it. It *probably* won't summon Cthulhu, or even seriously maim anyone you know!
> 
> wiki:
> http://www.dsource.org/projects/dmocks/wiki/DUnit
> download:
> http://www.dsource.org/projects/dmocks/browser/downloads/dunit.1.zip?format=raw 
> 
> 
> Don't be like the twenty-third elephant on the moon -- get yours today!

Hate to burst the bubble but not sure you can use the name DUnit as it exists for Delphi http://dunit.sourceforge.net/
March 13, 2008
DBloke wrote:
> Hate to burst the bubble but not sure you can use the name DUnit as it exists for Delphi http://dunit.sourceforge.net/

Well, I could write out the whole name of the language rather than just the first letter, and call it DUnit instead :)
March 14, 2008
Christopher Wright wrote:
> DBloke wrote:
>> Hate to burst the bubble but not sure you can use the name DUnit as it exists for Delphi http://dunit.sourceforge.net/
> 
> Well, I could write out the whole name of the language rather than just the first letter, and call it DUnit instead :)

You mean DProgrammingLanguageUnit. ;-)

--bb