Boost logo

Boost-Build :

From: Michael Peterson (michael148_at_[hidden])
Date: 2004-09-06 17:30:36


The documentation doesn't really explain much about the unit-test
target. Anyway, I've finally succeeded in building a small app that
links to the CPPunit lib and I'd like to incorporate the unit-test
target into my Jamfiles. I've tried several variations over the last
few hourse and have been completely unsuccessful. So, can someone tell
me how to set up a unit test based on the jamfiles below.

Here are my three Jamfiles.

######################
# ..\Long\Jamfile.v2
# Top level Jamfile.
######################
project test
: requirements <include>C:/local/sde/projects/cppunit-1.10.2/include
<include>lib
;

##############################
# ..\Long\lib
# Builds Number.cpp as a static lib
##############################
project Long
;

lib long
: Number.cpp
: <link>static
;

######################
# ..\Long\test\Jamfile.v2
# Builds the unit-test executable
######################
project main ;

exe main
# -- sources
: main.cpp NumberTest.cpp

# -- libs against which we link
../lib//long/<link>static
C:/local/sde/projects/cppunit-1.10.2/lib/cppunitd.lib
;

The last Jamfile builds the unit test, main.exe. I would like to be
able to use the unit-test target to invoke main.exe automatically. Any
help would, as always, be greatly appreciated.

Cheers,

Michael
 ------=_NextPart_000_0008_01C49426.757DBFE0 Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii"=
>
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2>The docum=
entation=20
doesn't really explain much about the unit-test target.&nbsp; Anyway, I've=
=20
finally succeeded in building a small app that links to the CPPunit lib and=
I'd=20
like to incorporate the unit-test target into my Jamfiles.&nbsp; I've tried=
=20
several variations over the last few hourse&nbsp;and have been completely=20
unsuccessful. So, can someone tell me how to set up a unit test based on th=
e=20
jamfiles below.</FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2>Here are =
my three=20
Jamfiles. </FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2><EM>######################</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM>#=20
..\Long\Jamfile.v2</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM># T=
op level=20
Jamfile.</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2><EM>######################</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM>pro=
ject=20
test<BR>&nbsp;&nbsp;&nbsp; : requirements=20
&lt;include&gt;C:/local/sde/projects/cppunit-1.10.2/include<BR>&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;include&gt;lib<BR>&nbsp;&nbsp;&nbsp; ;<BR></EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2><EM>##############################</EM></FONT></DIV>
<DIV><SPAN class=3D062271822-06092004></SPAN><FONT face=3DArial size=3D2>=
<EM>#<SPAN=20
class=3D062271822-06092004> ..\Long\lib</SPAN></EM></FONT></DIV>
<DIV><FONT><SPAN class=3D062271822-06092004></SPAN><SPAN=20
class=3D062271822-06092004></SPAN><FONT face=3DArial size=3D2><EM>#<SPAN=
=20
class=3D062271822-06092004> Builds Number.cpp as a static=20
lib</SPAN></EM></FONT></FONT></DIV>
<DIV><FONT><FONT><SPAN class=3D062271822-06092004></SPAN><SPAN=20
class=3D062271822-06092004></SPAN><FONT face=3DArial size=3D2><EM>#<SPAN=
=20
class=3D062271822-06092004>#############################</SPAN><BR>projec=
t=20
Long<BR>&nbsp;&nbsp;&nbsp; ;</EM></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM></EM></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><EM>lib long<BR>&nbsp;&nbsp;&nbsp; :=20
Number.cpp<BR>&nbsp;&nbsp;&nbsp; : &lt;link&gt;static<BR>&nbsp;&nbsp;&nbs=
p;=20
;</EM></FONT></DIV>
<DIV><EM><FONT face=3DArial size=3D2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2><EM>######################</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM>#=20
..\Long\test\Jamfile.v2</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM># B=
uilds the=20
unit-test executable</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2><EM>######################</EM></FONT></SPAN></DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM>pro=
ject main=20
;</EM></FONT></SPAN></DIV>
<DIV><EM></EM>&nbsp;</DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial size=3D2><EM>exe=
=20
main<BR>&nbsp;&nbsp;&nbsp; # -- sources<BR>&nbsp;&nbsp;&nbsp; : main.cpp=
=20
NumberTest.cpp</EM></FONT></SPAN></DIV>
<DIV><EM></EM>&nbsp;</DIV>
<DIV><SPAN class=3D062271822-06092004><FONT face=3DArial=20
size=3D2><EM>&nbsp;&nbsp;&nbsp; # -- libs against which we=20
link<BR>&nbsp;&nbsp;&nbsp;=20
../lib//long/&lt;link&gt;static<BR>&nbsp;&nbsp;&nbsp;=20
C:/local/sde/projects/cppunit-1.10.2/lib/cppunitd.lib<BR>&nbsp;&nbsp;&nbs=
p;=20
;</EM></FONT></SPAN></DIV></FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D062271822-06092004>The last =
Jamfile=20
builds the unit test, main.exe.&nbsp; I would like to be able to use the=20
unit-test target to invoke main.exe automatically. Any help would, as alway=
s, be=20
greatly appreciated.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D062271822-06092004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D062271822-06092004>Cheers,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D062271822-06092004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D062271822-06092004>Michael</SPAN></FONT></DIV></SPAN></BODY></HTML>
 ------=_NextPart_000_0008_01C49426.757DBFE0--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk