Boost with C code.. please help...

Hello, I am very new to Boost. I have to write unit test cases in order to increase the code coverage of a C source code. I am not getting the approach to start writing the test cases. As it is a code C code, there are huge number of functions, one calling the other, and a lot of global variables. Can anyone please help me out to get the approach to start writing Unit test cases. And, I have used a "c++" compiler for compiling small Boost programs. I am getting error while using "GCC" compiler. Can we use GCC compiler for compiling Boost program? How can we do this? Please help me out. Thanks in advance. Thanks, Kamalkishor.

AMDG On 02/02/2012 06:59 AM, Kamalkishor wrote:
Hello,
I am very new to Boost. I have to write unit test cases in order to increase the code coverage of a C source code.
I am not getting the approach to start writing the test cases.
As it is a code C code, there are huge number of functions, one calling the other, and a lot of global variables.
Can anyone please help me out to get the approach to start writing Unit test cases.
You want to test every aspect of the expected behavior of each function. Dealing with global variables is a pain, though. You should probably use a text fixture to reset them all for each test case.
And, I have used a "c++" compiler for compiling small Boost programs. I am getting error while using "GCC" compiler. Can we use GCC compiler for compiling Boost program? How can we do this?
c++ is GCC. It just adds the C++ runtime libraries to the linker and treats source files as C++. In Christ, Steven Watanabe

A good starting point is to select an appropriate unit test package. We use cxxtest in our program. There are several other good options. http://cxxtest.com/ http://cxxtest.tigris.org/ Documentation for cxxtest is fairly straightforward. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Thursday, February 02, 2012 12:13 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost with C code.. please help... AMDG On 02/02/2012 06:59 AM, Kamalkishor wrote:
Hello,
I am very new to Boost. I have to write unit test cases in order to increase the code coverage of a C source code.
I am not getting the approach to start writing the test cases.
As it is a code C code, there are huge number of functions, one calling the other, and a lot of global variables.
Can anyone please help me out to get the approach to start writing Unit test cases.
You want to test every aspect of the expected behavior of each function. Dealing with global variables is a pain, though. You should probably use a text fixture to reset them all for each test case.
And, I have used a "c++" compiler for compiling small Boost programs.
I am getting error while using "GCC" compiler. Can we use GCC compiler for compiling Boost program? How can we do
this?
c++ is GCC. It just adds the C++ runtime libraries to the linker and treats source files as C++. In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users - This message is intended only for the addressee and may contain information that is company confidential or privileged. Any technical data in this message may be exported only in accordance with the U.S. International Traffic in Arms Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 CFR Parts 730-774). Unauthorized use is strictly prohibited and may be unlawful. If you are not the intended recipient, or the person responsible for delivering to the intended recipient, you should not read, copy, disclose or otherwise use this message. If you have received this email in error, please delete it, and advise the sender immediately. -
participants (3)
-
Kamalkishor
-
Sargrad, Dave
-
Steven Watanabe