PageRenderTime 106ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/mordor/test/antxmllistener.h

http://github.com/mozy/mordor
C Header | 62 lines | 51 code | 11 blank | 0 comment | 0 complexity | 42a083ac824be5b7785e6ae6163025dc MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #ifndef __MORDOR_TEST_ANT_XML_LISTENER_H__
  2. #define __MORDOR_TEST_ANT_XML_LISTENER_H__
  3. #include <boost/shared_ptr.hpp>
  4. #include "test.h"
  5. namespace Mordor {
  6. namespace Test {
  7. class AntXMLLogSink;
  8. class AntXMLListener : public TestListener
  9. {
  10. public:
  11. AntXMLListener(const std::string &directory);
  12. ~AntXMLListener();
  13. void testStarted(const std::string &suite,
  14. const std::string &test);
  15. void testComplete(const std::string &suite,
  16. const std::string &test);
  17. void testSkipped(const std::string &suite,
  18. const std::string &tests);
  19. void testAsserted(const std::string &suite,
  20. const std::string &test, const Assertion &message);
  21. void testException(const std::string &suite,
  22. const std::string &test);
  23. void testsComplete();
  24. private:
  25. struct TestInfo
  26. {
  27. TestInfo() : start(~0ull), end(~0ull) {}
  28. unsigned long long start;
  29. unsigned long long end;
  30. std::string exceptionMessage;
  31. std::string exceptionType;
  32. std::string exceptionDetails;
  33. };
  34. struct TestSuiteInfo
  35. {
  36. TestSuiteInfo() : start(~0ull), end(~0ull), errors(0), failures(0) {}
  37. unsigned long long start;
  38. unsigned long long end;
  39. size_t errors;
  40. size_t failures;
  41. std::map<std::string, TestInfo> tests;
  42. boost::shared_ptr<std::ostringstream> out;
  43. boost::shared_ptr<std::ostringstream> err;
  44. };
  45. private:
  46. boost::shared_ptr<AntXMLLogSink> m_logSink;
  47. std::string m_directory;
  48. std::map<std::string, TestSuiteInfo > m_testSuites;
  49. };
  50. }}
  51. #endif