From mboxrd@z Thu Jan 1 00:00:00 1970 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 ) 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 ; 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: References: Date: Sun, 31 Jul 2011 11:21:34 +0000 Message-ID: From: John Smith To: Bitcoin Dev 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 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

On Sat= , Jul 30, 2011 at 2:07 PM, Matt Corallo <bitcoin-list@bluematt.me> wrote:
We already have boost testing framework implemented, it just doesn= 9;t
have many tests.

BTW, talking about the unit testf= ramework: It doesn't build here by default:

$ make -f makefile.unix test_bitcoin=A0 USE_UPNP=3D

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
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_s= tart':
(.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=A0 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
=A0=A0=A0=A0=A0=A0=A0 $(CXX) $(CFL= AGS) -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 ...)<= br>
JS





--000e0cd485ea9de97804a95bb76d--