The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
GaudiEnv.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
18#include <GaudiKernel/SmartIF.h>
19#include <sstream>
20#include <stdexcept>
21namespace GaudiTesting {
22 void throwConditionFailed( bool condition, const std::string& file_name, int line_no,
23 const std::string& condition_string );
24}
25
26#define Ensures( a ) GaudiTesting::throwConditionFailed( a, __FILE__, __LINE__, #a )
27#ifndef NDEBUG
28# define DEBUG_TRACE( a ) \
29 do { a; } while ( false )
30#else
31# define DEBUG_TRACE( a ) \
32 do { \
33 } while ( false )
34#endif
35
36namespace GaudiTesting {
37 class GaudiEnv {
38 public:
41 , m_svcMgr( m_iface )
42 , m_appMgr( m_iface )
44 , m_svcLoc( m_iface ) {
45 Ensures( m_iface != nullptr );
46 Ensures( m_svcMgr.isValid() );
47 Ensures( m_appMgr.isValid() );
48 Ensures( m_propMgr.isValid() );
49 Ensures( m_svcLoc.isValid() );
50 m_toolSvc = m_svcLoc->service( "ToolSvc" );
51 Ensures( m_toolSvc.isValid() );
52 m_propMgr->setProperty( "EvtSel", "NONE" ).ignore();
53 m_propMgr->setProperty( "JobOptionsType", "NONE" ).ignore();
54 Ensures( ( m_appMgr->configure().isSuccess() ) );
55 Ensures( ( m_appMgr->initialize().isSuccess() ) );
56 }
63 };
64} // namespace GaudiTesting
IInterface *PyHelper createApplicationMgr()
#define Ensures(a)
Definition GaudiEnv.h:26
SmartIF< IProperty > m_propMgr
Definition GaudiEnv.h:60
SmartIF< IAppMgrUI > m_appMgr
Definition GaudiEnv.h:59
SmartIF< ISvcManager > m_svcMgr
Definition GaudiEnv.h:58
SmartIF< ISvcLocator > m_svcLoc
Definition GaudiEnv.h:61
SmartIF< IToolSvc > m_toolSvc
Definition GaudiEnv.h:62
IInterface * m_iface
Definition GaudiEnv.h:57
Definition of the basic interface.
Definition IInterface.h:225
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
void throwConditionFailed(bool condition, const std::string &file_name, int line_no, const std::string &condition_string)