www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Pitching D to my new team at work tomorrow: wish me luck!

reply "Atila Neves" <atila.neves gmail.com> writes:
I'm going to try and get them to agree to use D to write unit 
tests in. We've inherited a C codebase, I think it's a good use 
case but then again I would.

I'm hoping to win them over with:

- Fast compilation times, making TDD easier
- No test registration (compile-time reflection)
- Easy oncurrent execution
- Look, it looks like C! (especially since it'll be testing C 
code)

I don't know if it'll be enough to win over C++, but as long as 
we escape the C trap for the unit tests as well I'll be happy.

Atila
Jan 15 2014
parent reply "bearophile" <bearophileHUGS lycos.com> writes:
Atila Neves:

 I don't know if it'll be enough to win over C++, but as long as 
 we escape the C trap for the unit tests as well I'll be happy.
The built-in D unittesting is handy, but it's a little underpowered. Bye, bearophile
Jan 15 2014
next sibling parent "Atila Neves" <atila.neves gmail.com> writes:
I meant this:

https://github.com/atilaneves/unit-threaded

On Wednesday, 15 January 2014 at 17:02:42 UTC, bearophile wrote:
 Atila Neves:

 I don't know if it'll be enough to win over C++, but as long 
 as we escape the C trap for the unit tests as well I'll be 
 happy.
The built-in D unittesting is handy, but it's a little underpowered. Bye, bearophile
Jan 15 2014
prev sibling next sibling parent "Meta" <jared771 gmail.com> writes:
On Wednesday, 15 January 2014 at 17:02:42 UTC, bearophile wrote:
 Atila Neves:

 I don't know if it'll be enough to win over C++, but as long 
 as we escape the C trap for the unit tests as well I'll be 
 happy.
The built-in D unittesting is handy, but it's a little underpowered. Bye, bearophile
Luckily there are some libraries in development to help with this: http://code.dlang.org/packages/dunit https://github.com/atilaneves/unit-threaded https://github.com/jostly/specd https://github.com/nomad-software/dunit
Jan 15 2014
prev sibling parent reply "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
On Wednesday, 15 January 2014 at 17:02:42 UTC, bearophile wrote:
 Atila Neves:

 I don't know if it'll be enough to win over C++, but as long 
 as we escape the C trap for the unit tests as well I'll be 
 happy.
The built-in D unittesting is handy, but it's a little underpowered. Bye, bearophile
But D's built-in unit testing is still more powerful than C++'s non-existing built-in unit testing, right? Or are the latest revisions to the C++ language adding that too? Good luck Atila
Jan 15 2014
parent "Aziz =?UTF-8?B?S8O2a3NhbCI=?= <aziz.koeksal gmail.com> writes:
On Wednesday, 15 January 2014 at 18:20:08 UTC, Craig Dillabaugh 
wrote:
 But D's built-in unit testing is still more powerful than C++'s 
 non-existing built-in unit testing, right?  Or are the latest 
 revisions to the C++ language adding that too?

 Good luck Atila
The only thing that built-in D-unittests buy you is that they get executed automatically in debug builds before main() is called. Sure it's convenient and may encourage developers to start writing tests right away, but after a while you'll find out that they are very limited. I'm not arguing against them, however, you have to use a library or write something yourself if you have higher requirements.
Jan 15 2014