PageRenderTime 29ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/mordor/test/compoundlistener.cpp

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