00001
00002 #define COMMON_MAIN_CPP
00003
00004
00005
00006 #include "GaudiKernel/SmartIF.h"
00007 #include "GaudiKernel/Bootstrap.h"
00008 #include "GaudiKernel/IAppMgrUI.h"
00009 #include "GaudiKernel/IProperty.h"
00010 #include "GaudiKernel/Property.h"
00011 #include "GaudiKernel/System.h"
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef WIN32
00022 void FATAL(const char* text){std::cerr << text << std::endl;}
00023 #endif // WIN32
00024
00025
00026
00027 int main( int argn, char** argc) {
00028
00029
00030
00031
00032
00033 const char * local_path = ::getenv("GLASTSVCROOT");
00034
00035 std::string joboptions_file = std::string(local_path? local_path: "");
00036
00037 joboptions_file += std::string("/src/test/jobOptions.txt");
00038
00039
00040
00041 IInterface* iface = Gaudi::createApplicationMgr();
00042
00043 SmartIF<IProperty> propMgr ( IID_IProperty, iface );
00044 SmartIF<IAppMgrUI> appMgr ( IID_IAppMgrUI, iface );
00045
00046
00047 StatusCode status = StatusCode::SUCCESS;
00048 if ( iface && propMgr == iface ) {
00049 status = propMgr->setProperty( StringProperty("JobOptionsPath", joboptions_file) );
00050 }
00051 else {
00052 exit(-1);
00053 }
00054
00055
00056
00057 if ( appMgr ) {
00058 status = appMgr->run();
00059 }
00060 else {
00061 return 0;
00062 }
00063
00064
00065 return 0;
00066
00067 }