From: <vac...@us...> - 2010-05-21 16:59:40
|
Revision: 185 http://xmlwrapp.svn.sourceforge.net/xmlwrapp/?rev=185&view=rev Author: vaclavslavik Date: 2010-05-21 16:59:34 +0000 (Fri, 21 May 2010) Log Message: ----------- Do global testsuite initialization properly. Instead of calling unit_test_main manually from main, do it the proper Boost.Test way: define BOOST_TEST_MAIN and have a global fixture for srcdir initialization. Modified Paths: -------------- trunk/tests/test_main.cxx Modified: trunk/tests/test_main.cxx =================================================================== --- trunk/tests/test_main.cxx 2010-04-29 12:21:58 UTC (rev 184) +++ trunk/tests/test_main.cxx 2010-05-21 16:59:34 UTC (rev 185) @@ -30,23 +30,21 @@ * SUCH DAMAGE. */ +#define BOOST_TEST_MAIN #include "test.h" #include <cstdlib> std::string srcdir = "."; -bool init_unit_test() +struct SrcdirConfig { - const char *s = std::getenv("srcdir"); - if ( s ) - srcdir = s; + SrcdirConfig() + { + const char *s = std::getenv("srcdir"); + if ( s ) + srcdir = s; + } +}; - return true; -} - -int main(int argc, char *argv[]) -{ - return boost::unit_test::unit_test_main(&init_unit_test, argc, argv); -} - +BOOST_GLOBAL_FIXTURE(SrcdirConfig); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |