www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DUnit beta released

reply Christopher Wright <dhasenan gmail.com> writes:
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!
Mar 11 2008
next sibling parent BCS <ao pathlink.com> writes:
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
Mar 11 2008
prev sibling next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
I can see that lot of people are writing many things for D brick by brick :-)

Christopher Wright:
 Have you spent time searching for a failed test because your tests are 
 interleaved with your code?
I think having tests very close to their code is a good thing. Bye, bearophile
Mar 12 2008
parent reply Christopher Wright <dhasenan gmail.com> writes:
bearophile wrote:
 I can see that lot of people are writing many things for D brick by brick :-)
I'm not entirely sure what you mean by that.
 Christopher Wright:
 Have you spent time searching for a failed test because your tests are 
 interleaved with your code?
I think having tests very close to their code is a good thing. Bye, bearophile
But...if you don't use DUnit, it's very likely that I might cry. On a more serious note, however you like to test, more power to you. xUnit's popular, though, and it's what I'm used to, so now I have it. And so does anyone else who wants it.
Mar 12 2008
parent BCS <ao pathlink.com> writes:
Reply to Christopher,

 bearophile wrote:
 
 I can see that lot of people are writing many things for D brick by
 brick :-)
 
I'm not entirely sure what you mean by that.
Progress, Slow n' steady progress. One by one, the little things make a language /really/ usable are getting done.
Mar 12 2008
prev sibling next sibling parent Derek Parnell <derek nomail.afraid.org> writes:
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
Mar 12 2008
prev sibling parent reply DBloke <DBloke nowhere.org> writes:
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/du
it.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/
Mar 13 2008
parent reply Christopher Wright <dhasenan gmail.com> writes:
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 :)
Mar 13 2008
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
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
Mar 13 2008