Merge branch 'tizen' into security-manager
[platform/core/test/security-tests.git] / src / framework / include / dpl / test / test_results_collector_console.h
1 /*
2  * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @file        test_results_collector_console.h
18  * @author      Marcin Niesluchowski (m.niesluchow@samsung.com)
19  * @version     1.0
20  * @brief       Header file containing ConsoleCollector class declaration
21  */
22
23 #ifndef DPL_TEST_RESULTS_COLLECTOR_CONSOLE_H
24 #define DPL_TEST_RESULTS_COLLECTOR_CONSOLE_H
25
26 #include <map>
27
28 #include <dpl/test/statistic.h>
29 #include <dpl/test/test_results_collector.h>
30
31 namespace DPL {
32 namespace Test {
33
34 class ConsoleCollector :
35     public TestResultsCollectorBase
36 {
37 public:
38     static TestResultsCollectorBase* Constructor();
39
40 private:
41     ConsoleCollector();
42
43     virtual bool ParseCollectorSpecificArg(const std::string& arg);
44     virtual std::string CollectorSpecificHelp() const;
45     virtual void CollectCurrentTestGroupName(const std::string& name);
46     virtual void CollectResult(const std::string& id, const TestResult &result);
47     virtual void Finish();
48
49     void PrintfErrorMessage(const char* type, const std::string& message);
50     void PrintfIgnoredMessage(const char* type, const std::string& message);
51     void PrintStats(const std::string& title, const Statistic& stats);
52
53     Statistic m_stats;
54     std::map<std::string, Statistic> m_groupsStats;
55     std::string m_currentGroup;
56     bool m_verbosity;
57 };
58
59 } // namespace Test
60 } // namespace DPL
61
62 #endif // DPL_TEST_RESULTS_COLLECTOR_CONSOLE_H