ATLAS Offline Software
Public Member Functions | Private Member Functions | List of all members
Athena_test::InitGaudiGoogleTest Class Reference

#include <InitGaudiGoogleTest.h>

Inheritance diagram for Athena_test::InitGaudiGoogleTest:
Collaboration diagram for Athena_test::InitGaudiGoogleTest:

Public Member Functions

 InitGaudiGoogleTest (MSG::Level level=MSG::INFO)
 Create GoogleTest fixture. More...
 
 InitGaudiGoogleTest (const std::string &jobOptsPath)
 Create GoogleTest fixture. More...
 
virtual ~InitGaudiGoogleTest ()
 dtor More...
 

Public Attributes

IAppMgrUI * theApp
 public members are visible in tests More...
 
SmartIF< IProperty > propMgr
 
SmartIF< ISvcLocator > svcLoc
 
SmartIF< ISvcManager > svcMgr
 
SmartIF< IToolSvc > toolSvc
 

Private Member Functions

 InitGaudiGoogleTest (const std::string &jobOptsPath, MSG::Level level)
 

Detailed Description

Definition at line 33 of file InitGaudiGoogleTest.h.

Constructor & Destructor Documentation

◆ InitGaudiGoogleTest() [1/3]

Athena_test::InitGaudiGoogleTest::InitGaudiGoogleTest ( MSG::Level  level = MSG::INFO)

Create GoogleTest fixture.

Parameters
levelMessageSvc OutputLevel

Definition at line 54 of file InitGaudiGoogleTest.cxx.

54  :

◆ InitGaudiGoogleTest() [2/3]

Athena_test::InitGaudiGoogleTest::InitGaudiGoogleTest ( const std::string &  jobOptsPath)

Create GoogleTest fixture.

Parameters
jobOptsPathPath to job options

Definition at line 51 of file InitGaudiGoogleTest.cxx.

51  :
52  InitGaudiGoogleTest(jobOptsPath, MSG::INFO) {}

◆ ~InitGaudiGoogleTest()

Athena_test::InitGaudiGoogleTest::~InitGaudiGoogleTest ( )
virtual

dtor

Definition at line 46 of file InitGaudiGoogleTest.cxx.

46  {
47  EXPECT_TRUE( theApp->finalize().isSuccess() );
48  EXPECT_TRUE( theApp->terminate().isSuccess() );
49  }

◆ InitGaudiGoogleTest() [3/3]

Athena_test::InitGaudiGoogleTest::InitGaudiGoogleTest ( const std::string &  jobOptsPath,
MSG::Level  level 
)
private

Definition at line 15 of file InitGaudiGoogleTest.cxx.

15  :
16  // create a new ApplicationMgr w/o singleton behaviour
17  theApp( Gaudi::createApplicationMgrEx( "GaudiCoreSvc", "ApplicationMgr" ) ),
18  propMgr( theApp ),
19  svcLoc( theApp ),
20  svcMgr( theApp ),
21  toolSvc( svcLoc->service("ToolSvc") )
22  {
23  EXPECT_TRUE( theApp != nullptr );
24  EXPECT_TRUE( propMgr.isValid() );
25  EXPECT_TRUE( svcLoc.isValid() );
26  EXPECT_TRUE( svcMgr.isValid() );
27  EXPECT_TRUE( toolSvc.isValid() );
28  // set the new ApplicationMgr as instance in Gaudi
29  Gaudi::setInstance( theApp );
30 
31  EXPECT_TRUE( propMgr->setProperty( "OutputLevel", std::to_string( level ) ).isSuccess() );
32  if (jobOptsPath.empty()) {
33  EXPECT_TRUE( propMgr->setProperty( "JobOptionsType", "NONE" ).isSuccess() );
34  }
35  else {
36  EXPECT_TRUE( propMgr->setProperty( "JobOptionsType", "FILE" ).isSuccess() );
37  EXPECT_TRUE( propMgr->setProperty( "JobOptionsPath", jobOptsPath ).isSuccess() );
38  }
39  EXPECT_TRUE( theApp->configure().isSuccess() );
40  EXPECT_TRUE( theApp->initialize().isSuccess() );
41  }

Member Data Documentation

◆ propMgr

SmartIF<IProperty> Athena_test::InitGaudiGoogleTest::propMgr

Definition at line 54 of file InitGaudiGoogleTest.h.

◆ svcLoc

SmartIF<ISvcLocator> Athena_test::InitGaudiGoogleTest::svcLoc

Definition at line 55 of file InitGaudiGoogleTest.h.

◆ svcMgr

SmartIF<ISvcManager> Athena_test::InitGaudiGoogleTest::svcMgr

Definition at line 56 of file InitGaudiGoogleTest.h.

◆ theApp

IAppMgrUI* Athena_test::InitGaudiGoogleTest::theApp

public members are visible in tests

Definition at line 53 of file InitGaudiGoogleTest.h.

◆ toolSvc

SmartIF<IToolSvc> Athena_test::InitGaudiGoogleTest::toolSvc

Definition at line 57 of file InitGaudiGoogleTest.h.


The documentation for this class was generated from the following files:
Athena_test::InitGaudiGoogleTest::theApp
IAppMgrUI * theApp
public members are visible in tests
Definition: InitGaudiGoogleTest.h:53
Athena_test::InitGaudiGoogleTest::svcMgr
SmartIF< ISvcManager > svcMgr
Definition: InitGaudiGoogleTest.h:56
Athena_test::InitGaudiGoogleTest::InitGaudiGoogleTest
InitGaudiGoogleTest(MSG::Level level=MSG::INFO)
Create GoogleTest fixture.
Definition: InitGaudiGoogleTest.cxx:54
Athena_test::InitGaudiGoogleTest::propMgr
SmartIF< IProperty > propMgr
Definition: InitGaudiGoogleTest.h:54
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Athena_test::InitGaudiGoogleTest::toolSvc
SmartIF< IToolSvc > toolSvc
Definition: InitGaudiGoogleTest.h:57
Athena_test::InitGaudiGoogleTest::svcLoc
SmartIF< ISvcLocator > svcLoc
Definition: InitGaudiGoogleTest.h:55