/mordor/test/compoundlistener.cpp
C++ | 75 lines | 64 code | 10 blank | 1 comment | 12 complexity | a23d3c162c99c9b7888e06c3b8432e35 MD5 | raw file
1// Copyright (c) 2010 - Mozy, Inc. 2 3#include "mordor/predef.h" 4 5#include "compoundlistener.h" 6 7using namespace Mordor; 8using namespace Mordor::Test; 9 10void 11CompoundListener::addListener(boost::shared_ptr<TestListener> listener) 12{ 13 m_listeners.push_back(listener); 14} 15 16void 17CompoundListener::testStarted(const std::string &suite, const std::string &test) 18{ 19 for (std::vector<boost::shared_ptr<TestListener> >::const_iterator it = 20 m_listeners.begin(); 21 it != m_listeners.end(); 22 ++it) 23 (*it)->testStarted(suite, test); 24} 25 26void 27CompoundListener::testComplete(const std::string &suite, const std::string &test) 28{ 29 for (std::vector<boost::shared_ptr<TestListener> >::const_iterator it = 30 m_listeners.begin(); 31 it != m_listeners.end(); 32 ++it) 33 (*it)->testComplete(suite, test); 34} 35 36void 37CompoundListener::testSkipped(const std::string &suite, const std::string &test) 38{ 39 for (std::vector<boost::shared_ptr<TestListener> >::const_iterator it = 40 m_listeners.begin(); 41 it != m_listeners.end(); 42 ++it) 43 (*it)->testSkipped(suite, test); 44} 45 46void 47CompoundListener::testAsserted(const std::string &suite, const std::string &test, 48 const Assertion &assertion) 49{ 50 for (std::vector<boost::shared_ptr<TestListener> >::const_iterator it = 51 m_listeners.begin(); 52 it != m_listeners.end(); 53 ++it) 54 (*it)->testAsserted(suite, test, assertion); 55} 56 57void 58CompoundListener::testException(const std::string &suite, const std::string &test) 59{ 60 for (std::vector<boost::shared_ptr<TestListener> >::const_iterator it = 61 m_listeners.begin(); 62 it != m_listeners.end(); 63 ++it) 64 (*it)->testException(suite, test); 65} 66 67void 68CompoundListener::testsComplete() 69{ 70 for (std::vector<boost::shared_ptr<TestListener> >::const_iterator it = 71 m_listeners.begin(); 72 it != m_listeners.end(); 73 ++it) 74 (*it)->testsComplete(); 75}