* [Bitcoin-development] Unit tests
[not found] <CAJNQ0svOGGZ+L6ffK2RA+wq-VawkdJKeQcjo4_0socLZUpwDyg@mail.gmail.com>
@ 2011-07-31 11:21 ` John Smith
2011-07-31 12:24 ` Matt Corallo
0 siblings, 1 reply; 3+ messages in thread
From: John Smith @ 2011-07-31 11:21 UTC (permalink / raw)
To: Bitcoin Dev
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 2241 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bitcoin-development] Unit tests
2011-07-31 11:21 ` [Bitcoin-development] Unit tests John Smith
@ 2011-07-31 12:24 ` Matt Corallo
2011-07-31 12:46 ` John Smith
0 siblings, 1 reply; 3+ messages in thread
From: Matt Corallo @ 2011-07-31 12:24 UTC (permalink / raw)
To: bitcoin-development
On Sun, 2011-07-31 at 11:21 +0000, John Smith wrote:
>
> 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
See pull 363 and 442 :)
Matt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bitcoin-development] Unit tests
2011-07-31 12:24 ` Matt Corallo
@ 2011-07-31 12:46 ` John Smith
0 siblings, 0 replies; 3+ messages in thread
From: John Smith @ 2011-07-31 12:46 UTC (permalink / raw)
To: Matt Corallo; +Cc: bitcoin-development
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
>
> See pull 363 and 442 :)
>
Great. I really hope these get pulled ASAP, having the tests all over the
place in different forks is really confusing :(
JS
[-- Attachment #2: Type: text/html, Size: 361 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-31 12:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAJNQ0svOGGZ+L6ffK2RA+wq-VawkdJKeQcjo4_0socLZUpwDyg@mail.gmail.com>
2011-07-31 11:21 ` [Bitcoin-development] Unit tests John Smith
2011-07-31 12:24 ` Matt Corallo
2011-07-31 12:46 ` John Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox