www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Unit tests in D

reply bearophile <bearophileHUGS lycos.com> writes:
Lutger:
 I don't know. This is how you can unittest a single module:
 rdmd --main -unittest test.d
 it just links in a predefined .d file with a main() routine, that's all.

I have done some tests, but I am not able to use it well, or there are some bugs, I don't know. But even if it works, I don't know if that can solve the problem at hand, because modules call each other, and I don't know if that command compiles just one module with -unittest. Bye and sorry, bearophile
May 07 2010
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
bearophile wrote:
 Lutger:
 I don't know. This is how you can unittest a single module:
 rdmd --main -unittest test.d
 it just links in a predefined .d file with a main() routine, that's all.

I have done some tests, but I am not able to use it well, or there are some bugs, I don't know. But even if it works, I don't know if that can solve the problem at hand, because modules call each other, and I don't know if that command compiles just one module with -unittest. Bye and sorry, bearophile

Passing --chatty to rdmd prints the dmd invocation before executing it. Andrei
May 07 2010
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Leandro Lucarella wrote:
 Andrei Alexandrescu, el  7 de mayo a las 06:59 me escribiste:
 bearophile wrote:
 Lutger:
 I don't know. This is how you can unittest a single module:
 rdmd --main -unittest test.d
 it just links in a predefined .d file with a main() routine, that's all.

But even if it works, I don't know if that can solve the problem at hand, because modules call each other, and I don't know if that command compiles just one module with -unittest. Bye and sorry, bearophile


I wonder why you always pick clever names, what's wrong with --verbose?

It was easily confused with dmd's -v. Andrei
May 07 2010
prev sibling parent Leandro Lucarella <llucax gmail.com> writes:
Andrei Alexandrescu, el  7 de mayo a las 06:59 me escribiste:
 bearophile wrote:
Lutger:
I don't know. This is how you can unittest a single module:
rdmd --main -unittest test.d
it just links in a predefined .d file with a main() routine, that's all.

I have done some tests, but I am not able to use it well, or there are some bugs, I don't know. But even if it works, I don't know if that can solve the problem at hand, because modules call each other, and I don't know if that command compiles just one module with -unittest. Bye and sorry, bearophile

Passing --chatty to rdmd prints the dmd invocation before executing it.

I wonder why you always pick clever names, what's wrong with --verbose? -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- Hello? Is there anybody in there? Just nod if you can hear me. Is there anyone at home?
May 07 2010