diff options
Diffstat (limited to 'TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h')
-rw-r--r-- | TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h b/TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h new file mode 100644 index 00000000000..c578974dee9 --- /dev/null +++ b/TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h @@ -0,0 +1,47 @@ +// $Id$ +#ifndef TESTAPPMAIN_H +#define TESTAPPMAIN_H + +#include "ace/Log_Msg.h" +#include "ace/SString.h" +#include "tao/Exception.h" +#include "tao/Environment.h" + +#define TEST_APP_MAIN(APP_TYPE) \ +int \ +main(int argc, char* argv[]) \ +{ \ + ACE_LOG_MSG->priority_mask(LM_TRACE | \ + LM_DEBUG | \ + LM_INFO | \ + LM_NOTICE | \ + LM_WARNING | \ + LM_ERROR | \ + LM_CRITICAL | \ + LM_ALERT | \ + LM_EMERGENCY, \ + ACE_Log_Msg::PROCESS); \ +\ + APP_TYPE app; \ +\ + try \ + { \ + int ret = app.run(argc,argv); \ +\ + return ret; \ + } \ + catch (const CORBA::Exception& ex) \ + { \ + ex._tao_print_exception ("Caught exception:"); \ + } \ + catch (...)\ + { \ + ACE_ERROR((LM_ERROR, \ + "(%P|%t) Unknown (...) exception caught in main() " \ + "for App [%d].\n", app.name())); \ + } \ + \ + return 1; \ +} + +#endif |