IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
UnitTestInit.h
Go to the documentation of this file.
1 // UnitTestInit.h:
3 // ---------------
4 //
14 
15 #ifndef __IPSDKUNITTESTTOOLS_UNITTESTINIT_H__
16 #define __IPSDKUNITTESTTOOLS_UNITTESTINIT_H__
17 
18 #include <boost/test/unit_test.hpp>
19 #include <boost/preprocessor/stringize.hpp>
20 #include <log4cplus/consoleappender.h>
21 #include <UnitTest/IPSDKUnitTestTools/UnitTestConfigurator.h>
22 #include <IPSDKCore/Config/LibraryInitializer.h>
25 #include <UnitTest/IPSDKUnitTestTools/UnitTestUtils.h>
26 
27 
28 
29 
30 namespace ipsdk {
31 namespace unittest {
32 
35 
37 static void
38 customizeConfiguration(ipsdk::core::LibraryUserConfiguration& libraryUserConfiguration);
39 
41 static UnitTestConfigurator g_unitTestConfigurator(&customizeConfiguration);
42 
45 
46 } // end of namespace unittest
47 } // end of namespace ipsdk
48 
49 
53 #define IPSDK_INIT_UNITTEST(UnitTestName) \
54 int main(int argc, char** argv) \
55 { \
56  try { \
57  boost::unit_test::master_test_suite_t& masterTestSuite = \
58  boost::unit_test::framework::master_test_suite(); \
59  masterTestSuite.argc = argc; \
60  masterTestSuite.argv = argv; \
61  ipsdk::unittest::g_unitTestConfigurator.test_start(0); \
62  ipsdk::unittest::setUnitTestName(BOOST_PP_STRINGIZE(UnitTestName)); \
63  int res = ::boost::unit_test::unit_test_main(&init_unit_test, argc, argv); \
64  ipsdk::unittest::g_unitTestConfigurator.test_finish(0); \
65  return res; \
66  } \
67  catch (const std::exception& e) { \
68  IPSDKUNITTESTTOOLS_LOG_ERROR( \
69  [ipsdk::unittest::eIPSDKUnitTestToolsMessage::eUnHandleExeptionValue] % e.what()); \
70  } \
71  return -1; \
72 }
73 
74 
75 #endif // __IPSDKUNITTESTTOOLS_UNITTESTINIT_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Logger api for library IPSDKUnitTestTools.
Log messages description.
User configuration for IPSDK library.
Definition: LibraryUserConfiguration.h:33