Typedefs | Functions
geometry_test.cxx File Reference
#include "test/Geometry/GeometryTestAlg.h"
#include "test/Geometry/geometry_unit_test_base.h"
#include "Geometry/GeometryCore.h"
#include "Geometry/ChannelMapAlgs/ChannelMapStandardAlg.h"
#include "messagefacility/MessageLogger/MessageLogger.h"

Go to the source code of this file.

Typedefs

using StandardGeometryConfiguration = testing::BasicGeometryEnvironmentConfiguration< gar::geo::seg::ChannelMapStandardAlg >
 
using StandardGeometryTestEnvironment = testing::GeometryTesterEnvironment< StandardGeometryConfiguration >
 

Functions

int main (int argc, char const **argv)
 Runs the test. More...
 

Typedef Documentation

Definition at line 36 of file geometry_test.cxx.

Definition at line 45 of file geometry_test.cxx.

Function Documentation

int main ( int  argc,
char const **  argv 
)

Runs the test.


Parameters
argcnumber of arguments in argv
argvarguments to the function
Returns
number of detected errors (0 on success)
Exceptions
cet::exceptionmost of error situations throw

The arguments in argv are: 0. name of the executable ("Geometry_test")

  1. path to the FHiCL configuration file
  2. FHiCL path to the configuration of the geometry test (default: physics.analysers.geotest)
  3. FHiCL path to the configuration of the geometry (default: services.Geometry)

Definition at line 69 of file geometry_test.cxx.

69  {
70 
71  StandardGeometryConfiguration config("geometry_test");
72  config.SetMainTesterParameterSetName("geotest");
73 
74  //
75  // parameter parsing
76  //
77  int iParam = 0;
78 
79  // first argument: configuration file (mandatory)
80  if (++iParam < argc) config.SetConfigurationPath(argv[iParam]);
81 
82  // second argument: path of the parameter set for geometry test configuration
83  // (optional; default: "physics.analysers.geotest")
84  if (++iParam < argc) config.SetMainTesterParameterSetPath(argv[iParam]);
85 
86  // third argument: path of the parameter set for geometry configuration
87  // (optional; default: "services.Geometry" from the inherited object)
88  if (++iParam < argc) config.SetGeometryParameterSetPath(argv[iParam]);
89 
90  //
91  // testing environment setup
92  //
94 
95  //
96  // run the test algorithm
97  //
98 
99  // 1. we initialize it from the configuration in the environment,
100  gar::geo::GeometryTestAlg Tester(TestEnvironment.TesterParameters());
101 
102  // 2. we set it up with the geometry from the environment
103  Tester.Setup(*(TestEnvironment.Provider<gar::geo::GeometryCore>()));
104 
105  // 3. then we run it!
106  unsigned int nErrors = Tester.Run();
107 
108  // 4. And finally we cross fingers.
109  if (nErrors > 0) {
110  mf::LogError("geometry_test") << nErrors << " errors detected!";
111  }
112 
113  return nErrors;
114 } // main()
Performs tests on the geometry as seen by Geometry service.
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
static Config * config
Definition: config.cpp:1054
testing::TesterEnvironment< testing::BasicEnvironmentConfiguration > TestEnvironment
virtual void Setup(geo::GeometryCore const &new_geo)
Runs the test.
testing::GeometryTesterEnvironment< StandardGeometryConfiguration > StandardGeometryTestEnvironment