LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-01-2008, 06:09 AM   #1
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 489

Rep: Reputation: 49
Unit Test Framework for C


Hello all,

I'm looking for an unit test framework for C programs, and there's plenty of... So if any user of this kind of software can tell me his/her advice on some of them, with pro and cons...

I'm looking for complexity measurment softwares too...

Thanks.

Last edited by jf.argentino; 07-01-2008 at 06:24 AM.
 
Old 07-02-2008, 09:32 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 33
See www.sourceforge.net for Cunit
 
Old 07-02-2008, 10:08 AM   #3
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 489

Original Poster
Rep: Reputation: 49
Thanks but my problem isn't to found a tool (I found something like 12 open sources framework), but to choose one (or two) between them: I can't try each framework.
So if you know "Cunit" please give me your opinion on it (good and bad), some of its capabilities (HTML output, automaticaly make tests from commented sources...)
 
Old 07-02-2008, 10:28 AM   #4
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
One option is to program a (usually small, if you don't want to spend a lot of time) unit test program yourself that fits your personal needs. A simple one can be coded in a day or few, so it's not an overwhelming task..but if you do want to stick to the "ready" solutions (there are good reasons to do that too), you do need to try them out yourself to find which one of them suits your needs well. It's like you'd ask "hey guys, which web/C/Java/name-something-here development IDE suits me best?" - there's only one person on the planet who knows the answer for real

My opinion about cunit is "good", but I haven't used it much so it could be just that.
 
Old 07-03-2008, 08:25 AM   #5
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 489

Original Poster
Rep: Reputation: 49
Quote:
you do need to try them out yourself to find which one of them suits your needs well
I can't disagree with that... But, as i'm not well aware of unit testing concept, i'm not sure what are my needs, that's why I have posted my question like this "Hey guy, what unit test do you use, and what do you like/dislike about it", to have many different advices from different users, and help me identify what are my needs which can be filled by such tools...

Quote:
One option is to program a (usually small, if you don't want to spend a lot of time) unit test program yourself that fits your personal needs
Until now, it's more or less how I work, i make my own test case for each components i'm programming. But it's heavy (one function = N test cases where N is the number or validity spaces of my entry argument), and not really usable for regression tests or really big projects since my tests just stops at the first error, and more over no test coverage rate based on a measure...

So, for now, my needs are:
-test case automatically (more or less, OK less) done by the framework from commented sources: i don't know if some frameworks provide this kind of mechanism, but programs like "splint" (or "doxygen" for another purpose than testing) use comment syntax, maybe some unit testing framework does that too?
-"Real" results reports: not just "One test failed so just stop", but something like %95 success, %5 fail, with file and line for each failures. I hope all frameworks provide this, but maybe not, so if you're aware of one which doesn't, I won't test it.
-Code covered by test case, I want to be sure that 99% of my code is covered by tests, not just rely on my hope that I've not forget one logical branch...

Do you know if Cunit provide these features?

Thanks for any more advice.
 
Old 07-03-2008, 01:02 PM   #6
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,858
Blog Entries: 1

Rep: Reputation: Disabled
jf.argentino -

Quote:
Don't follow leaders ... watch your parking meters
- Bob Dylan
Try out a couple of the 12 frameworks that you found, and see what *you* think.

CUnit is an excellent choice (IMHO) ... but you should make up your own mind, based on your own needs and preferences
 
  


Reply

Tags
framework, unit


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Storage unit and IO unit salmanucit Linux - General 1 06-17-2008 07:05 PM
LXer: One programmer's unit test is another's integration test LXer Syndicated Linux News 0 07-29-2007 03:46 AM
LXer: Unit test your PHP code at every level LXer Syndicated Linux News 0 08-16-2006 10:33 PM
LXer: Mozilla invites users to pre-test a test LXer Syndicated Linux News 0 08-09-2006 11:12 PM
problems with my CD-RW unit devit Linux - General 4 02-02-2004 11:53 AM


All times are GMT -5. The time now is 05:40 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration