From b29e5800752ecefbe4e9317ac908e40d9c6eded0 Mon Sep 17 00:00:00 2001 From: dai_y Date: Wed, 19 Oct 2005 00:27:51 +0000 Subject: Tue Oct 18 17:24:26 MST 2005 Yan Dai --- .../CSD_Strategy/TestInf/TestAppMain.h | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h (limited to 'TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h') 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..062b6fc0c8e --- /dev/null +++ b/TAO/performance-tests/CSD_Strategy/TestInf/TestAppMain.h @@ -0,0 +1,49 @@ +// $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; \ +\ + ACE_TRY_NEW_ENV \ + { \ + int ret = app.run(argc,argv ACE_ENV_ARG_PARAMETER); \ + ACE_TRY_CHECK; \ + return ret; \ + } \ + ACE_CATCHANY \ + { \ + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, \ + "Caught exception:"); \ + } \ + ACE_CATCHALL \ + { \ + ACE_ERROR((LM_ERROR, \ + "(%P|%t) Unknown (...) exception caught in main() " \ + "for App [%d].\n", app.name())); \ + } \ + ACE_ENDTRY; \ + \ + return 1; \ +} + +#endif -- cgit v1.2.1