Board index » cppbuilder » BDS2006: C++ Unit Testing

BDS2006: C++ Unit Testing


2006-04-27 08:06:22 PM
cppbuilder41
When looking at BDS 2006, I remember seeing some IDE support for NUnit, a standard unit testing framework for .NET. It seems to be available only for C#. I would love to see something like this for C++.
Does anyone have any recommendations for doing NUnit-style unit testing with C++ in BDS 2006?
Stephen
 
 

Re:BDS2006: C++ Unit Testing

"Stephen Schaub" < XXXX@XXXXX.COM >wrote:
Quote

Please set the line length for your reader so that it wraps
your lines when you post.
Quote
[...] Does anyone have any recommendations for doing NUnit-
style unit testing with C++ in BDS 2006?
It doesn't exist (yet) and there is no reliable expectation of
when or if it ever will.
~ JD
 

Re:BDS2006: C++ Unit Testing

"JD" < XXXX@XXXXX.COM >wrote:
Quote

"Stephen Schaub" < XXXX@XXXXX.COM >wrote:
>

Please set the line length for your reader so that it wraps
your lines when you post.
I am using the Borland web interface to the newsgroups.
I assumed it would wrap; I'll try doing manual newlines
in this post.
Quote

>[...] Does anyone have any recommendations for doing NUnit-
>style unit testing with C++ in BDS 2006?

It doesn't exist (yet) and there is no reliable expectation of
when or if it ever will.

Thanks for the reply. I think I need to rephrase the question.
I'm not so much looking for NUnit unit testing, as I am a way
to accomplish what NUnit makes possible -- automated unit
tests and Test First Programming. Are there any best practices
on this, especially related to the C++ Builder IDE? This is
something I've grown accustomed to with Visual Studio and
Eclipse, and I'm looking for a way to accomplish similar
things in C++ Builder.
As I see it, the main obstacle is C++'s top-level main()
function. To do automated unit tests, you would want to
override the application's main() function with one containing
an automated unit test. I assume it's not possible to have more
than one main() function in a project.
I could rig up a solution using #ifdef ... #endif, so that
a preprocessor symbol could control whether the project
was built to run a unit test or the real app. I'm just
looking for helpful suggestions or examples before I go
forging my own path.
Thanks in advance,
Stephen
 

{smallsort}

Re:BDS2006: C++ Unit Testing

Hi Stephen,
I don't know about automated unit tests that will plug directly into
BDS, but I have worked with CPP Unit testing tools before. One I can
recommend CPP Unit, it can be found here:
cppunit.sourceforge.net/cgi-bin/moin.cgi
Though it hasn't yet been integrated with the BDS environment, i would
love to see someone do so at some point. As the output is command line
based it shouldn't be too difficult to add, but as I don't have my copy
of BDS yet I'm not sure how it could be done.
Anyway, hope that helps you.
Regards
Dan
 

Re:BDS2006: C++ Unit Testing

"Stephen Schaub" < XXXX@XXXXX.COM >wrote:
Quote

I am using the Borland web interface to the newsgroups.
Me too!
Quote
I assumed it would wrap; [...]
Next time you post, read what's directly under the subject
line.
Quote
[...] I think I need to rephrase the question.
Whoah boy did I ever misunderstand. I thought that you were
asking about C++ for .Net <g>and the most accurate answer
on that is that Borland is thinking about it.
Quote
I'm not so much looking for NUnit unit testing, as I am a way
to accomplish what NUnit makes possible [...] I could rig up
a solution using #ifdef ... #endif,
AFAIK, that's the only way to do it with Borland's C++ line.
~ JD
 

Re:BDS2006: C++ Unit Testing

Stephen Schaub wrote:
Quote

"JD" < XXXX@XXXXX.COM >wrote:
>
>"Stephen Schaub" < XXXX@XXXXX.COM >wrote:
>>
>
>>[...] Does anyone have any recommendations for doing NUnit-
>>style unit testing with C++ in BDS 2006?
>
Have you had a look at boost test ?
--
frode
 

Re:BDS2006: C++ Unit Testing

Have you looked at 'TestComplete' at www.automatedqa.com?