Thread overview
Pitching D to my new team at work tomorrow: wish me luck!
Jan 15, 2014
Atila Neves
Jan 15, 2014
bearophile
Jan 15, 2014
Atila Neves
Jan 15, 2014
Meta
Jan 15, 2014
Craig Dillabaugh
Jan 15, 2014
Aziz Köksal
January 15, 2014
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
January 15, 2014
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
January 15, 2014
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

January 15, 2014
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
January 15, 2014
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
January 15, 2014
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.