Thread overview
unit testing
Mar 28, 2011
Ishan Thilina
Mar 28, 2011
David Nadlinger
Mar 28, 2011
Caligo
Mar 28, 2011
David Nadlinger
Mar 28, 2011
Ishan Thilina
Mar 28, 2011
Jonathan M Davis
Mar 29, 2011
Ishan Thilina
March 28, 2011
I see that almost all of the phobos library files have "unittests". Were these unit tests were created using some framework? If so, then what is it?

Thank you...!
March 28, 2011
On 3/28/11 4:23 PM, Ishan Thilina wrote:
> I see that almost all of the phobos library files have "unittests". Were these
> unit tests were created using some framework? If so, then what is it?
>
> Thank you...!

No, these unit test were just written by hand while writing the corresponding pieces of code, and extended after a bug was fixed which they previously missed.

Or was your question related to actually running them?

David
March 28, 2011
On Mon, Mar 28, 2011 at 9:34 AM, David Nadlinger <see@klickverbot.at> wrote:
> On 3/28/11 4:23 PM, Ishan Thilina wrote:
>>
>> I see that almost all of the phobos library files have "unittests". Were
>> these
>> unit tests were created using some framework? If so, then what is it?
>>
>> Thank you...!
>
> No, these unit test were just written by hand while writing the corresponding pieces of code, and extended after a bug was fixed which they previously missed.
>
> Or was your question related to actually running them?
>
> David
>

and how does one do unit testing with GDC?  It works fine with DMD, but GDC doesn't do unit testing when -unittest is supplied.
March 28, 2011
On 3/28/11 5:55 PM, Caligo wrote:
> and how does one do unit testing with GDC?  It works fine with DMD,
> but GDC doesn't do unit testing when -unittest is supplied.

-funittest, IIRC.

David
March 28, 2011
@David:

No, my question was not about running them,but on how that code was generated. I thought they were auto generated using a unitest framework :). Your answer clarifies everything. Thank you..! :-)
March 28, 2011
On 2011-03-28 11:29, Ishan Thilina wrote:
> @David:
> 
> No, my question was not about running them,but on how that code was generated. I thought they were auto generated using a unitest framework :). Your answer clarifies everything. Thank you..! :-)

LOL. Goodness no. They're done by hand. I'm currently reworking std.datetime's unit tests, and it's very time consuming (since it's a large module with lots of tests). I don't know how you'd get a framework to generate what I want anyway. The fact that D has unit testing built in like it does is fantastic, but it is fairly simplistic.

- Jonathan M Davis
March 29, 2011
- Jonathan M Davis wrote:

>LOL. Goodness no. They're done by hand. I'm currently reworking std.datetime's unit tests, and it's very time consuming (since it's a large module with lots of tests). I don't know how you'd get a framework to generate what I want anyway. The fact that D has unit testing built in like it does is fantastic, but it is fairly simplistic.

I'm new to this concept of uni testing. Thanks for the help :)