All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geometry_iterator_icarus_test.cxx
Go to the documentation of this file.
1 /**
2  * @file geometry_iterator_icarus_test.cxx
3  * @brief Unit test for geometry iterators on ICARUS detector.
4  * @date October 10, 2017
5  * @author Gianluca Petrillo (petrillo@fnal.gov)
6  *
7  * Usage: just run the executable.
8  * Boost unit testing environment keeps the arguments secret anyway.
9  */
10 
11 // Boost test libraries; defining this symbol tells boost somehow to generate
12 // a main() function; Boost is pulled in by geometry_boost_unit_test_base.h
13 #define BOOST_TEST_MODULE GeometryIteratorTestICARUS
14 
15 // ICARUS libraries
17 
18 // LArSoft libraries
22 
23 //------------------------------------------------------------------------------
24 //--- The test environment
25 //---
26 
27 // we define here all the configuration that is needed;
28 // in the specific, the type of the channel mapping and a proper test name,
29 // used for output only; we use IcarusGeometryEnvironmentConfiguration
30 // as base class, that is already configured to use ICARUS geometry.
31 // We wrap it in testing::BoostCommandLineConfiguration<> so that it can learn
32 // the configuration file name from the command line.
35  icarus::testing::IcarusGeometryEnvironmentConfiguration
36  <icarus::ICARUSChannelMapAlg>
37  >
38 {
39  /// Constructor: overrides the application name; ignores command line
41  { SetApplicationName("GeometryIteratorUnitTest"); }
42 }; // class IcarusGeometryConfiguration
43 
44 /*
45  * Our fixture is based on GeometryTesterFixture, configured with the object
46  * above.
47  * It provides:
48  * - `Tester`, a configured instance of the test algorithm.
49  */
51  private testing::GeometryTesterEnvironment<IcarusGeometryConfiguration>
52 {
53  public:
55 
56  /// Constructor: initialize the tester with the Geometry from base class
58  { Tester.Setup(*Geometry()); }
59 
60 }; // class IcarusGeometryIteratorTestFixture
61 
62 
63 
64 //------------------------------------------------------------------------------
65 //--- The tests
66 //---
67 
69  (GeometryIteratorsIcarus, IcarusGeometryIteratorTestFixture)
70 // BOOST_GLOBAL_FIXTURE(IcarusGeometryIteratorTestFixture);
71 
72 
73 BOOST_AUTO_TEST_CASE( AllTests )
74 {
75  Tester.Run();
76 } // BOOST_AUTO_TEST_CASE( AllTests )
77 
78 /*
79 BOOST_AUTO_TEST_CASE( CryostatIteratorsTest )
80 {
81  Tester.CryostatIteratorsTest();
82 } // BOOST_AUTO_TEST_CASE( CryostatIteratorsTest )
83 
84 
85 
86 BOOST_AUTO_TEST_CASE( TPCIteratorsTest )
87 {
88  Tester.TPCIteratorsTest();
89 } // BOOST_AUTO_TEST_CASE( TPCIteratorsTest )
90 
91 
92 
93 BOOST_AUTO_TEST_CASE( PlaneIteratorsTest )
94 {
95  Tester.PlaneIteratorsTest();
96 } // BOOST_AUTO_TEST_CASE( PlaneIteratorsTest )
97 
98 
99 
100 BOOST_AUTO_TEST_CASE( WireIteratorsTest )
101 {
102  Tester.WireIteratorsTest();
103 } // BOOST_AUTO_TEST_CASE( WireIteratorsTest )
104 */
105 
106 BOOST_AUTO_TEST_SUITE_END()
107 
BOOST_AUTO_TEST_CASE(AllTests)
Channel mapping algorithms for ICARUS detector.
Class for objects initializing ICARUS geometry.
void SetApplicationName(std::string name)
Sets the name of the application.
BOOST_FIXTURE_TEST_SUITE(GeometryIteratorsIcarus, IcarusGeometryIteratorTestFixture) BOOST_AUTO_TEST_CASE(AllTests)
virtual void Setup(geo::GeometryCore const &new_geo)
Algorithm set up.
IcarusGeometryConfiguration()
Constructor: overrides the application name; ignores command line.
Tests the correct iteration of the geo::Geometry iterators.
Class holding a configuration for a Boost test fixture.
Environment for a geometry test.
Base class for tests using Boost unit test library.
IcarusGeometryIteratorTestFixture()
Constructor: initialize the tester with the Geometry from base class.
fhicl::ParameterSet TesterParameters() const
Returns the configuration of the main test (undefined if no main test)
geo::GeometryCore const * Geometry() const
Returns a pointer to the geometry.