blitzdg
an open-source project aiming to implement parallel discontinuous Galerkin (dg) solvers for common partial differential equations systems using blitz++ for array and tensor manipulations and MPI for distributed parallelism.
testlisteneraggregator.h
1 
2 // Copyright Joakim Karlsson & Kim Gräsman 2010-2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef IGLOO_TESTLISTENER_AGGREGATOR_H
8 #define IGLOO_TESTLISTENER_AGGREGATOR_H
9 
10 namespace igloo {
12  {
13  public:
14  void AddListener(TestListener* listener)
15  {
16  listeners_.push_back(listener);
17  }
18 
19  void TestRunStarting()
20  {
21  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
22  {
23  (*it)->TestRunStarting();
24  }
25  }
26 
27  void TestRunEnded(const TestResults& results)
28  {
29  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
30  {
31  (*it)->TestRunEnded(results);
32  }
33  }
34 
35  void ContextRunStarting(const ContextBase& context)
36  {
37  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
38  {
39  (*it)->ContextRunStarting(context);
40  }
41  }
42 
43  void ContextRunEnded(const ContextBase& context)
44  {
45  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
46  {
47  (*it)->ContextRunEnded(context);
48  }
49  }
50 
51  void SpecRunStarting(const ContextBase& context, const std::string& specName)
52  {
53  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
54  {
55  (*it)->SpecRunStarting(context, specName);
56  }
57  }
58 
59  void SpecSucceeded(const ContextBase& context, const std::string& specName)
60  {
61  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
62  {
63  (*it)->SpecSucceeded(context, specName);
64  }
65  }
66 
67  void SpecFailed(const ContextBase& context, const std::string& specName)
68  {
69  for(TestListeners::const_iterator it = listeners_.begin(); it != listeners_.end(); it++)
70  {
71  (*it)->SpecFailed(context, specName);
72  }
73  }
74 
75  private:
76  typedef std::list<TestListener*> TestListeners;
77  TestListeners listeners_;
78  };
79 }
80 
81 #endif
Definition: testlistener.h:14
Definition: testlisteneraggregator.h:11
Definition: context.h:13
Definition: contextbase.h:15
Definition: testresults.h:12