2 * Copyright (c) 2011 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>
38 class TestResultsCollectorBase;
39 typedef std::shared_ptr<TestResultsCollectorBase>
40 TestResultsCollectorBasePtr;
42 class TestResultsCollectorBase
43 : private DPL::Noncopyable
46 typedef TestResultsCollectorBase* (*CollectorConstructorFunc)();
47 typedef std::list<std::string> TestCaseIdList;
59 virtual ~TestResultsCollectorBase() {}
61 virtual bool Configure() { return true; }
62 virtual void Start() { }
63 virtual void Finish() { }
64 virtual void CollectCurrentTestGroupName(const std::string& /*groupName*/) {}
66 virtual void CollectTestsCasesList(const TestCaseIdList& /*list*/) {}
67 virtual void CollectResult(const std::string& id,
68 const std::string& description,
69 const FailStatus::Type status = FailStatus::NONE,
70 const std::string& reason = "") = 0;
71 virtual std::string CollectorSpecificHelp() const { return ""; }
72 virtual bool ParseCollectorSpecificArg (const std::string& /*arg*/)
77 static TestResultsCollectorBase* Create(const std::string& name);
78 static void RegisterCollectorConstructor(const std::string& name,
79 CollectorConstructorFunc constructor);
80 static std::vector<std::string> GetCollectorsNames();
83 typedef std::map<std::string, CollectorConstructorFunc> ConstructorsMap;
84 static ConstructorsMap m_constructorsMap;
90 #endif /* DPL_TEST_RESULTS_COLLECTOR_H */