PageRenderTime 61ms CodeModel.GetById 19ms app.highlight 6ms RepoModel.GetById 35ms 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
 1#ifndef __MORDOR_TEST_ANT_XML_LISTENER_H__
 2#define __MORDOR_TEST_ANT_XML_LISTENER_H__
 3
 4#include <boost/shared_ptr.hpp>
 5
 6#include "test.h"
 7
 8namespace Mordor {
 9namespace Test {
10
11class AntXMLLogSink;
12
13class AntXMLListener : public TestListener
14{
15public:
16    AntXMLListener(const std::string &directory);
17    ~AntXMLListener();
18
19    void testStarted(const std::string &suite,
20        const std::string &test);
21    void testComplete(const std::string &suite,
22        const std::string &test);
23    void testSkipped(const std::string &suite,
24        const std::string &tests);
25    void testAsserted(const std::string &suite,
26        const std::string &test, const Assertion &message);
27    void testException(const std::string &suite,
28        const std::string &test);
29    void testsComplete();
30
31private:
32    struct TestInfo
33    {
34        TestInfo() : start(~0ull), end(~0ull) {}
35        unsigned long long start;
36        unsigned long long end;
37        std::string exceptionMessage;
38        std::string exceptionType;
39        std::string exceptionDetails;
40    };
41
42    struct TestSuiteInfo
43    {
44        TestSuiteInfo() : start(~0ull), end(~0ull), errors(0), failures(0) {}
45        unsigned long long start;
46        unsigned long long end;
47        size_t errors;
48        size_t failures;
49        std::map<std::string, TestInfo> tests;
50        boost::shared_ptr<std::ostringstream> out;
51        boost::shared_ptr<std::ostringstream> err;
52    };
53
54private:
55    boost::shared_ptr<AntXMLLogSink> m_logSink;
56    std::string m_directory;
57    std::map<std::string, TestSuiteInfo > m_testSuites;
58};
59
60}}
61
62#endif