RE: Help regarding Unit Test
King Dale <[email protected]> Mon, 17 Mar 2003 09:38:48 -0500
| Newsgroups | gmane.comp.lib.cppunit.devel |
|---|---|
| Message-ID | <5720E1EA0BD6D411B30600508BF3739102A982A9@INDYEXCH32> |
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2EC92.EB8ECD60 Content-Type: text/plain; charset="iso-8859-1" > Message: 1 > Date: Fri, 14 Mar 2003 09:28:50 -0800 (PST) > From: Dk Pat <pathy_dk-/[email protected]> > To: [email protected] > Subject: [Cppunit-devel] Help regarding Unit Test > > Hi, > I have developed some mathematical functions which > is both compatible to C/ C++ and are running under > Linux machine. I have not written the assertion macros > in the .C files. > > Now my question is : > > 1. Is is possible to pass the source file (.c/ > .cpp) as a parameter to any standard function/ command > of CppUnit s/w for the testing without adding the > macros and classes to the .c/ .cpp file ? Not sure if I completely understand your question, but what I have done when testing a C file is to create a wrapper file for the file being tested. That wrapper includes the file to be tested and contain any definitions include you need to use it in your testing environment. If the file is compilable in C++ I will use a C++ wrapper file and put the file to be tested in its own namespace. ---------------------------------------------------------------------------- ---- As of February 12th, 2003 Thomson unified its email addresses on a worldwide basis. Please note my new email address: [email protected] http://www.thomson.net/ ------_=_NextPart_001_01C2EC92.EB8ECD60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2653.12"> <TITLE>RE: Help regarding Unit Test</TITLE> </HEAD> <BODY> <P><FONT SIZE=3D2>> Message: 1</FONT> <BR><FONT SIZE=3D2>> Date: Fri, 14 Mar 2003 09:28:50 -0800 = (PST)</FONT> <BR><FONT SIZE=3D2>> From: Dk Pat <pathy_dk-/[email protected]></FONT> <BR><FONT SIZE=3D2>> To: [email protected]</FONT> <BR><FONT SIZE=3D2>> Subject: [Cppunit-devel] Help regarding Unit = Test</FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Hi,</FONT> <BR><FONT SIZE=3D2>> I have developed some = mathematical functions which</FONT> <BR><FONT SIZE=3D2>> is both compatible to C/ C++ and are running = under</FONT> <BR><FONT SIZE=3D2>> Linux machine. I have not written the assertion = macros</FONT> <BR><FONT SIZE=3D2>> in the .C files. </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Now my question is = :</FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> 1. Is is possible = to pass the source file (.c/</FONT> <BR><FONT SIZE=3D2>> .cpp) as a parameter to any standard function/ = command</FONT> <BR><FONT SIZE=3D2>> of CppUnit s/w for the testing without adding = the</FONT> <BR><FONT SIZE=3D2>> macros and classes to the .c/ .cpp file ? = </FONT> </P> <P><FONT SIZE=3D2>Not sure if I completely understand your question, = but what I have done when testing a C file is to create a wrapper file = for the file being tested. That wrapper includes the file to be tested = and contain any definitions include you need to use it in your testing = environment. If the file is compilable in C++ I will use a C++ wrapper = file and put the file to be tested in its own namespace.</FONT></P> <P><FONT = SIZE=3D2>---------------------------------------------------------------= ----------------- </FONT> <BR><FONT SIZE=3D2>As of February 12th, 2003 Thomson unified its email = addresses on a worldwide basis. </FONT> <BR><FONT SIZE=3D2>Please note my new email address: = [email protected] </FONT> </P> <P><FONT SIZE=3D2><A HREF=3D"http://www.thomson.net/" = TARGET=3D"_blank">http://www.thomson.net/</A> </FONT> </P> </BODY> </HTML> ------_=_NextPart_001_01C2EC92.EB8ECD60-- ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en