Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191]
	helo=mx.sourceforge.net)
	by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <witchspace81@gmail.com>) id 1QnU5V-0003lU-47
	for bitcoin-development@lists.sourceforge.net;
	Sun, 31 Jul 2011 11:21:41 +0000
Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com
	designates 74.125.83.47 as permitted sender)
	client-ip=74.125.83.47; envelope-from=witchspace81@gmail.com;
	helo=mail-gw0-f47.google.com; 
Received: from mail-gw0-f47.google.com ([74.125.83.47])
	by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-MD5:128)
	(Exim 4.76) id 1QnU5U-00079J-2c
	for bitcoin-development@lists.sourceforge.net;
	Sun, 31 Jul 2011 11:21:41 +0000
Received: by gwb11 with SMTP id 11so4206060gwb.34
	for <bitcoin-development@lists.sourceforge.net>;
	Sun, 31 Jul 2011 04:21:34 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.7.20 with SMTP id k20mr90988ybi.117.1312111294539; Sun, 31
	Jul 2011 04:21:34 -0700 (PDT)
Received: by 10.150.52.5 with HTTP; Sun, 31 Jul 2011 04:21:34 -0700 (PDT)
In-Reply-To: <CAJNQ0svOGGZ+L6ffK2RA+wq-VawkdJKeQcjo4_0socLZUpwDyg@mail.gmail.com>
References: <CAJNQ0svOGGZ+L6ffK2RA+wq-VawkdJKeQcjo4_0socLZUpwDyg@mail.gmail.com>
Date: Sun, 31 Jul 2011 11:21:34 +0000
Message-ID: <CAJNQ0suWuaeNCA0MDp6Sef4EE1ibSg=YPVWY93cpqKig_reZXg@mail.gmail.com>
From: John Smith <witchspace81@gmail.com>
To: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Content-Type: multipart/alternative; boundary=000e0cd485ea9de97804a95bb76d
X-Spam-Score: 0.3 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	1.7 URIBL_WS_SURBL Contains an URL listed in the WS SURBL blocklist
	[URIs: bluematt.me]
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(witchspace81[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	0.1 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in
	digit (witchspace81[at]gmail.com)
	1.0 HTML_MESSAGE           BODY: HTML included in message
	-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
	author's domain
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
	-0.8 AWL AWL: From: address is in the auto white-list
X-Headers-End: 1QnU5U-00079J-2c
Subject: [Bitcoin-development]  Unit tests
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Sun, 31 Jul 2011 11:21:41 -0000

--000e0cd485ea9de97804a95bb76d
Content-Type: text/plain; charset=ISO-8859-1

Oops, should have gone to the list

On Sat, Jul 30, 2011 at 2:07 PM, Matt Corallo <bitcoin-list@bluematt.me>wrote:

> On Sat, 2011-07-30 at 07:06 -0700, Rick Wesson wrote:
> > +1
> >
> > Putting a bounty on the test framework might put some loose change to
> work.
> >
> > http://code.google.com/p/googletest/ would be my choice
> >
> > the list of c++ frameworks is at
> > http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B
>
> We already have boost testing framework implemented, it just doesn't
> have many tests.
>

BTW, talking about the unit testframework: It doesn't build here by default:

$ make -f makefile.unix test_bitcoin  USE_UPNP=

g++ -static  -o test_bitcoin  obj/test/test_bitcoin.o -Wl,-Bstatic -l
boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l
db_cxx -l ssl -l crypto -Wl,-Bdynamic -l gthread-2.0 -l z -l dl -l pthread
-lboost_unit_test_framework
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [test_bitcoin] Error 1

Two ways to fix this:

1) Add #define BOOST_TEST_DYN_LINK  to the top of test_bitcoin.cpp. This is
needed for dynamic linking.

2) Link boost_unit_test_framework statically

test_bitcoin: obj/test/test_bitcoin.o
        $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -Wl,-Bstatic
-lboost_unit_test_framework -Wl,-Bdynamic

(yes, it needs the switch to dynamic again at the end, otherwise libgcc will
be linked statically which results in an error ...)

JS

--000e0cd485ea9de97804a95bb76d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Oops, should have gone to the list<br><br><div class=3D"gmail_quote">On Sat=
, Jul 30, 2011 at 2:07 PM, Matt Corallo <span dir=3D"ltr">&lt;<a href=3D"ma=
ilto:bitcoin-list@bluematt.me" target=3D"_blank">bitcoin-list@bluematt.me</=
a>&gt;</span> wrote:<br>
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Sat, 2011-07-30 at 07:06 -0700, Rick Wesson wrote:<br>
&gt; +1<br>
&gt;<br>
&gt; Putting a bounty on the test framework might put some loose change to =
work.<br>
&gt;<br>
&gt; <a href=3D"http://code.google.com/p/googletest/" target=3D"_blank">htt=
p://code.google.com/p/googletest/</a> would be my choice<br>
&gt;<br>
&gt; the list of c++ frameworks is at<br>
&gt; <a href=3D"http://en.wikipedia.org/wiki/List_of_unit_testing_framework=
s#C.2B.2B" target=3D"_blank">http://en.wikipedia.org/wiki/List_of_unit_test=
ing_frameworks#C.2B.2B</a><br>
<br>
</div>We already have boost testing framework implemented, it just doesn&#3=
9;t<br>
have many tests.<br></blockquote><div><br>BTW, talking about the unit testf=
ramework: It doesn&#39;t build here by default:<br>
<br>
$ make -f makefile.unix test_bitcoin=A0 USE_UPNP=3D<br><br>
g++ -static=A0 -o test_bitcoin=A0 obj/test/test_bitcoin.o -Wl,-Bstatic -l=
=20
boost_system -l boost_filesystem -l boost_program_options -l=20
boost_thread -l db_cxx -l ssl -l crypto -Wl,-Bdynamic -l gthread-2.0 -l z
 -l dl -l pthread -lboost_unit_test_framework<br>
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_s=
tart&#39;:<br>
(.text+0x20): undefined reference to `main&#39;<br>
collect2: ld returned 1 exit status<br>
make: *** [test_bitcoin] Error 1<br>
<br>
Two ways to fix this:<br>
<br>
1) Add #define BOOST_TEST_DYN_LINK=A0 to the top of test_bitcoin.cpp. This =
is needed for dynamic linking.<br>
<br>
2) Link boost_unit_test_framework statically<br><br>
test_bitcoin: obj/test/test_bitcoin.o<br>=A0=A0=A0=A0=A0=A0=A0 $(CXX) $(CFL=
AGS) -o $@ $(LIBPATHS) $^ $(LIBS) -Wl,-Bstatic -lboost_unit_test_framework =
-Wl,-Bdynamic<br><br>(yes, it needs the switch to dynamic again at the end,=
 otherwise libgcc will be linked statically which results in an error ...)<=
br>


<br>
JS<br><br><br><br><br></div></div>
</div><br>

--000e0cd485ea9de97804a95bb76d--