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.h
18 * @author Lukasz Wrzosek (l.wrzosek@samsung.com)
20 * @brief Header file with declaration of TestResultsCollectorBase
23 #ifndef DPL_TEST_RESULTS_COLLECTOR_H
24 #define DPL_TEST_RESULTS_COLLECTOR_H
26 #include <dpl/noncopyable.h>
36 class TestResultsCollectorBase;
37 typedef std::shared_ptr<TestResultsCollectorBase>
38 TestResultsCollectorBasePtr;
40 class TestResultsCollectorBase :
41 private DPL::Noncopyable
44 typedef TestResultsCollectorBase* (*CollectorConstructorFunc)();
45 typedef std::list<std::string> TestCaseIdList;
53 virtual ~TestResultsCollectorBase() {}
55 virtual bool Configure()
59 virtual void Start() { }
60 virtual void Finish() { }
61 virtual void CollectCurrentTestGroupName(const std::string& /*groupName*/)
64 virtual void CollectTestsCasesList(const TestCaseIdList& /*list*/) {}
65 virtual void CollectResult(const std::string& id,
66 const FailStatus status = FailStatus::NONE,
67 const std::string& reason = "",
68 const bool& isPerformanceTest = false,
69 const std::chrono::system_clock::duration& performanceTime = std::chrono::microseconds::zero(),
70 const std::chrono::system_clock::duration& performanceMaxTime = std::chrono::microseconds::zero()) = 0;
71 virtual std::string CollectorSpecificHelp() const
75 virtual bool ParseCollectorSpecificArg (const std::string& /*arg*/)
80 static TestResultsCollectorBase* Create(const std::string& name);
81 static void RegisterCollectorConstructor(
82 const std::string& name,
83 CollectorConstructorFunc
85 static std::vector<std::string> GetCollectorsNames();
88 typedef std::map<std::string, CollectorConstructorFunc> ConstructorsMap;
89 static ConstructorsMap m_constructorsMap;
94 #endif /* DPL_TEST_RESULTS_COLLECTOR_H */