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

Go to the source code of this file.

Typedefs

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

Functions

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

Typedef Documentation

Definition at line 37 of file geometry_test.cxx.

Definition at line 47 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 71 of file geometry_test.cxx.

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