2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file test_results_collector_xml.h
18 * @author Marcin Niesluchowski (m.niesluchow@samsung.com)
20 * @brief Header file containing XmlCollector class declaration
23 #ifndef DPL_TEST_RESULTS_COLLECTOR_XML_H
24 #define DPL_TEST_RESULTS_COLLECTOR_XML_H
26 #include <dpl/scoped_fclose.h>
27 #include <dpl/test/statistic.h>
28 #include <dpl/test/test_results_collector.h>
34 public TestResultsCollectorBase
37 static TestResultsCollectorBase* Constructor();
42 virtual std::string CollectorSpecificHelp() const;
43 virtual bool ParseCollectorSpecificArg(const std::string& arg);
44 virtual bool Configure();
46 virtual void CollectCurrentTestGroupName(const std::string& name);
47 virtual void CollectResult(const std::string& id,
48 const FailStatus status = FailStatus::NONE,
49 const std::string& reason = "",
50 const bool& isPerformanceTest = false,
51 const std::chrono::system_clock::duration& performanceTime
52 = std::chrono::microseconds::zero(),
53 const std::chrono::system_clock::duration& performanceMaxTime
54 = std::chrono::microseconds::zero());
55 virtual void Finish();
57 void GroupStart(const std::size_t pos, const std::string& name);
58 std::size_t GetCurrentGroupPosition() const;
59 void UpdateGroupHeader(const std::size_t groupPosition,
60 const unsigned int tests,
61 const unsigned int failures,
62 const unsigned int skipped);
63 void UpdateElementAttribute(const std::size_t elementPosition,
64 const std::string& name,
65 const std::string& value);
66 std::string UIntToString(const unsigned int value);
67 void GroupFinish(const std::size_t groupPosition);
68 void PrintfErrorMessage(const char* type, const std::string& message);
69 void PrintfIgnoredMessage(const char* type, const std::string& message);
71 std::string EscapeSpecialCharacters(std::string s);
73 std::string m_filename;
76 std::string m_outputBuffer;
77 std::string m_resultBuffer;
84 #endif // DPL_TEST_RESULTS_COLLECTOR_XML_H