OTest2
A C++ testing framework
scenariosuite.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Ondrej Starek
3  *
4  * This file is part of OTest2
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2_INCLUDE_OTEST2_SCENARIOSUITE_H_
21 #define OTest2_INCLUDE_OTEST2_SCENARIOSUITE_H_
22 
23 #include <string>
24 
27 
28 namespace OTest2 {
29 
30 class Tags;
31 
36  public:
37  struct Impl;
38 
39  private:
40  Impl* pimpl;
41 
42  public:
50  explicit ScenarioSuite(
51  const std::string& name_,
52  const Tags& tags_,
53  ObjectRepeaterFactoryPtr repeater_factory_);
54 
58  virtual ~ScenarioSuite();
59 
60  /* -- avoid copying */
62  const ScenarioSuite&) = delete;
64  const ScenarioSuite&) = delete;
65 
66  /* -- scenario */
68  TagsStack& tags_,
69  ScenarioContainerPtr parent_,
70  const RunnerFilter& filter_) const override;
71  virtual std::pair<std::string, ObjectRepeaterPtr> createRepeater(
72  const Context& context_) const override;
73  virtual void enterObject(
74  const Context& context_) const noexcept override;
75  virtual void leaveObject(
76  const Context& context_) const noexcept override;
77  virtual ScenarioIterPtr getChildren() const override;
78 
79  /* -- scenario container */
80  virtual void appendScenario(
81  ScenarioPtr scenario_) override;
82  virtual bool isEmpty() const noexcept;
83 };
84 
85 } /* -- namespace OTest2 */
86 
87 #endif /* -- OTest2_INCLUDE_OTEST2_SCENARIOSUITE_H_ */
OTest2::RunnerFilter
Generic interface of a runner filter.
Definition: runnerfilter.h:35
OTest2::ScenarioContainer
Generic interface of a scenario container.
Definition: scenariocontainer.h:34
OTest2::ScenarioSuite::~ScenarioSuite
virtual ~ScenarioSuite()
Dtor.
Definition: scenariosuite.cpp:84
OTest2::ScenarioSuite
A scenario object representing one test suite.
Definition: scenariosuite.h:35
OTest2::ScenarioSuite::appendScenario
virtual void appendScenario(ScenarioPtr scenario_) override
Append new sub-scenario into the container.
Definition: scenariosuite.cpp:139
OTest2::ScenarioSuite::filterScenario
virtual ScenarioPtr filterScenario(TagsStack &tags_, ScenarioContainerPtr parent_, const RunnerFilter &filter_) const override
Filter the scenario.
Definition: scenariosuite.cpp:88
OTest2::ScenarioSuite::operator=
ScenarioSuite & operator=(const ScenarioSuite &)=delete
OTest2::ScenarioSuite::getChildren
virtual ScenarioIterPtr getChildren() const override
Get iterator of children object.
Definition: scenariosuite.cpp:135
OTest2::ScenarioSuite::createRepeater
virtual std::pair< std::string, ObjectRepeaterPtr > createRepeater(const Context &context_) const override
Create repeater object for testing object represented by this scenario object.
Definition: scenariosuite.cpp:113
objectrepeaterfactoryptr.h
OTest2::ObjectRepeaterFactoryPtr
std::shared_ptr< ObjectRepeaterFactory > ObjectRepeaterFactoryPtr
Shared pointer of the object repeater factories.
Definition: objectrepeaterfactoryptr.h:27
OTest2
Definition: assertbean.h:25
OTest2::ScenarioSuite::ScenarioSuite
ScenarioSuite(const std::string &name_, const Tags &tags_, ObjectRepeaterFactoryPtr repeater_factory_)
Create scenario object of a test suite.
Definition: scenariosuite.cpp:76
OTest2::ScenarioIterPtr
std::shared_ptr< ScenarioIter > ScenarioIterPtr
Shared pointer of the scenario iter interface.
Definition: scenarioiterptr.h:27
OTest2::ScenarioPtr
std::shared_ptr< Scenario > ScenarioPtr
Shared pointer of the scenario object.
Definition: scenarioptr.h:27
OTest2::ScenarioSuite::enterObject
virtual void enterObject(const Context &context_) const noexcept override
Enter the testing object.
Definition: scenariosuite.cpp:118
OTest2::TagsStack
Stack of assigned tags.
Definition: tagsstack.h:36
OTest2::Tags
List of tags assigned to a testing object.
Definition: tags.h:32
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::ScenarioSuite::leaveObject
virtual void leaveObject(const Context &context_) const noexcept override
Report leaving of the testing object.
Definition: scenariosuite.cpp:126
OTest2::ScenarioSuite::isEmpty
virtual bool isEmpty() const noexcept
Check whether the container is empty.
Definition: scenariosuite.cpp:145
OTest2::ScenarioContainerPtr
std::shared_ptr< ScenarioContainer > ScenarioContainerPtr
Shared pointer to a scenario container.
Definition: scenariocontainerptr.h:27
scenariocontainer.h