[test] how to use register_exception_translator with auto_test?

How can I use the the register_exception_translater with the Auto unit test framework? With boost 1.31 / VC7.1 I wrote a dummy test only containing the register_exception_translator call. This works fine, but with boost 1.33 / gcc3.3 this workaround does not work. Any Suggestions? Jörg

"Jörg Becker"
wrote in message news:200607271752.43452.becker@flexis.de... How can I use the the register_exception_translater with the Auto unit test framework? With boost 1.31 / VC7.1 I wrote a dummy test only containing the register_exception_translator call. This works fine, but with boost 1.33 / gcc3.3 this workaround does not work.
Latest cvs version of Boost.Test doesn't make any separation in auto/non-auto unit test framework. You could use init_unit_test to perform any kind of initialization you need including call to register_exception_translater. Also I believe you could employ global fixture feature. Gennadiy

Latest cvs version of Boost. Test doesn't make any separation in auto/non-auto unit test framework. You could use init_unit_test to perform any kind of initialization you need including call to register_exception_translater. Using the init_unit_test was what I tried first, but this give me a 'redefinition' compile error, because the auto unit test framework provides
On Friday, 28. July 2006 16:25, Gennadiy Rozental wrote: this function.
Also I believe you could employ global fixture feature. Is this new in 1.34? I cannot find it in the 1.33 docu. I think this is very similiar to my dummy test trick, but much nicer. The problem in both cases is how to get the unit_test_monitor or execution_monitor which are running my auto tests. In boost 1.31 I could simpy call register_exception_translator<>() but in 1.33 I have to call unit_test_monitor.register_exception_translator<>().
Joerg

I have a small project I' trying to build with bjam but I'm having difficulties... my directory structure is the following root of project /data/cmdwx4/pst subproject ElementMeteo /tmp/data/cmdwx4/pst/tmp/ElementMeteo subproject TestMatAlgos /tmp/data/cmdwx4/pst/tmp/TestMatAlgos in the root of project I have the following files Jamfile project-root ; subinclude ElementMeteo ; subinclude TestMatAlgos ; Jamrules path-global BOOST_ROOT : /data/cmdwx4/pst/package/boost_cvs ; project boost : $(BOOST_ROOT) ; project elementmeteo : ElementMeteo ; project testmatalgos : TestMatAlgos ; ALL_LOCATE_TARGET = /data/cmdwx4/pst/tmp/mylibs ; boost-build.jam boost-build /data/cmdwx4/pst/package/boost_cvs/tools/build/v1 ; in /tmp/data/cmdwx4/pst/tmp/ElementMeteo Jamfile subproject ElementMeteo ; SOURCES = Altitude.cpp ElementMeteo.cpp FacadeElementMeteo.cpp GeoReferencement.cpp HauteurGeopotentielle.cpp Humidite.cpp MouvementVertical.cpp Precipitation.cpp Pression.cpp Temperature.cpp VentHorizontal.cpp ; template base : ## Requirements ## : <debug><include>/data/cmdwx4/pst/linux/dev/include/boost-1_35 <release><include>/data/cmdwx4/pst/linux/op/include/boost-1_35 ## default-BUILD ## : debug release <debug><runtime-link>dynamic <release><runtime-link>dynamic ; dll elementmeteo : $(SOURCES) <template>base : common-variant-tag : debug release ; template elmet : <dll>elementmeteo : #<sysinclude>../../.. ; in /tmp/data/cmdwx4/pst/tmp/TestMatAlgos Jamfile subproject TestMatAlgos ; SOURCES = DataSet.cpp IMO.cpp IMOTest.cpp LoggerStuff.cpp MatrixAlgorithm2DTest.cpp MatrixAlgorithm3DTest.cpp TestMinMax.cpp ; if $(UNIX) { switch $(JAMUNAME) { case IRIX* : { lib-path = /data/cmdwx4/pst/sgi ; } case Linux* : { lib-path = /data/cmdwx4/pst/linux ; } } } template base : ## Requirements ## : <debug><include>$(lib-path)/dev/include/boost-1_35 <debug><include>$(lib-path)/dev/include <release><include>$(lib-path)/op/include/boost-1_35 <release><include>$(lib-path)/op/include <include>@elementmeteo <template>@elementmeteo/elmet ### this does not seem to work <dll>@elementmeteo/elementmeteo ### this does not seem to work <find-library>dl <find-library>cppunit <gcc><*><find-library>boost_log-gcc <mipspro><*><find-library>boost_log-mp ## default-BUILD ## : debug release <debug><runtime-link>dynamic <release><runtime-link>dynamic ; exe TestMatAlgos : $(SOURCES) <template>base : common-variant-tag : debug release ; What I want to be able to do: 1 - create a shared library with the ElementMeteo --- this is working 2 - create an executable that links with the ElementMeteo library --- this does not work 3 - be able to compile the whole project in one shot --- mostly working -- Sébastien Fortier

"Jörg Becker"
Latest cvs version of Boost. Test doesn't make any separation in auto/non-auto unit test framework. You could use init_unit_test to perform any kind of initialization you need including call to register_exception_translater. Using the init_unit_test was what I tried first, but this give me a 'redefinition' compile error, because the auto unit test framework
On Friday, 28. July 2006 16:25, Gennadiy Rozental wrote: provides this function.
This will work with cvs sources.
Also I believe you could employ global fixture feature. Is this new in 1.34? I cannot find it in the 1.33 docu. I think this is very
I think so.
similiar to my dummy test trick, but much nicer. The problem in both cases is how to get the unit_test_monitor or execution_monitor which are running my auto tests. In boost 1.31 I could simpy call register_exception_translator<>() but in 1.33 I have to call unit_test_monitor.register_exception_translator<>().
Sounds about right.
Joerg
Gennaidy

Yes you are right. It works with the cvs label RC_1_34. So I hope the 1.34 will be released soon. An other thing to take care about is the include order. The auto_unit_test.hpp must be included after unit_test.hpp and unit_test_monitor.hpp. Otherways I'm still getting the redefinition compile error. Thanks for your help! Jörg

"Jorg Becker"
Yes you are right. It works with the cvs label RC_1_34. So I hope the 1.34 will be released soon. An other thing to take care about is the include order. The auto_unit_test.hpp must be included after unit_test.hpp and
auto_unit_test.hpp is depricated. Boost.Test doesn't separate auto tools anymore
unit_test_monitor.hpp. Otherways I'm still getting the redefinition compile error.
Gennadiy
participants (3)
-
Gennadiy Rozental
-
Jörg Becker
-
Sebastien Fortier