
Can anyone point me in the direction of a Boost.Test example for the following scenario? 1. I have a standard install of boost trunk (svn co boost-trunk, make, make install) 2. For each class in my program, I have a cpp file containing tests for it 3. All the tests should be compiled together into a single executable I have read all the threads here I could find, and the (beta) documentation site, but I am finding all of the different link/main/initialization options very confusing, and I can't seem to find any complete examples. Help! Richard

Richard Dingwall
Can anyone point me in the direction of a Boost.Test example for the following scenario?
1. I have a standard install of boost trunk (svn co boost-trunk, make, make install) 2. For each class in my program, I have a cpp file containing tests for it 3. All the tests should be compiled together into a single executable
I have read all the threads here I could find, and the (beta) documentation site, but I am finding all of the different link/main/initialization options very confusing, and I can't seem to find any complete examples.
Help!
What kind of setup would you prefer: link to the library or not, dynamic or
static library?
What compiler r u using? Which version of Boost?
BTW, what do u find confusing in documentation?
Here is one scenario:
class_A_test.cpp:
-------------
#include

On Sat, May 17, 2008 at 3:11 PM, Gennadiy Rozental
What kind of setup would you prefer: link to the library or not, dynamic or static library?
This is one of the things I found confusing - I don't really care if it's static or dynamic, and I don't really want to have to specially recompile part of boost. Can I just link against the libboost_unit_test_framework-mt-1_35.dylib that got installed in /usr/local/lib/ when I installed boost? Otherwise, what is the _simplest_ way to get this up and running?
What compiler r u using? Which version of Boost?
GCC 4.0.1 and boost 1.35 (trunk). Rich

Richard Dingwall
writes: This is one of the things I found confusing - I don't really care if it's static or dynamic, and I don't really want to have to specially recompile part of boost. Can I just link against the libboost_unit_test_framework-mt-1_35.dylib that got installed in /usr/local/lib/ when I installed boost?
Yes. Just add #define BOOST_TEST_DYN_LINK on top of main.cpp in example I gave before.
Otherwise, what is the _simplest_ way to get this up and running?
From where I stand everything is simple and trivial ;)
Let me know how it works for u. Gennadiy

On Sat, May 17, 2008 at 6:06 PM, Gennadiy Rozental
Let me know how it works for u.
It compiles now (source + makefile attached), but when I try to run it, I get: Test setup error: system_error produced by: ::sigaltstack( &sigstk, 0 ) != -1: Cannot allocate memory I had this problem before, so I figured I was doing something wrong. Any ideas? Richard

Richard Dingwall wrote:
It compiles now (source + makefile attached), but when I try to run it, I get:
Test setup error: system_error produced by: ::sigaltstack( &sigstk, 0 ) != -1: Cannot allocate memory
I had this problem before, so I figured I was doing something wrong. Any ideas?
What compiler/OS r u using? Gennadiy

On Mon, May 19, 2008 at 6:37 AM, Gennadiy Rozental
What compiler/OS r u using?
powerbook:boost_test_example richard$ gcc -v Using built-in specs. Target: powerpc-apple-darwin9 Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --program-prefix= --host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9 Thread model: posix gcc version 4.0.1 (Apple Inc. build 5465) powerbook:boost_test_example richard$ uname -a Darwin powerbook.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:23:43 PST 2008; root:xnu-1228.4.31~1/RELEASE_PPC Power Macintosh powerbook:boost_test_example richard$ Mac OS X 10.5 on a G4 Powerbook.
participants (2)
-
Gennadiy Rozental
-
Richard Dingwall