OTest2
A C++ testing framework
cmdstate.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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_CMDSTATE_H_
21 #define OTest2__INCLUDE_OTEST2_CMDSTATE_H_
22 
23 #include <string>
24 
25 #include <otest2/caseordinaryptr.h>
26 #include <otest2/command.h>
27 
28 namespace OTest2 {
29 
30 class CmdState : public Command {
31  private:
32  CaseOrdinaryPtr testcase;
33  std::string name;
34  int delay;
35 
36  public:
37  /* -- avoid copying */
38  CmdState(
39  const CmdState&) = delete;
41  const CmdState&) = delete;
42 
50  explicit CmdState(
51  CaseOrdinaryPtr testcase_,
52  const std::string& name_,
53  int delay_);
54 
58  virtual ~CmdState();
59 
60  /* -- command interface */
61  virtual void run(
62  const Context& context_);
63 };
64 
65 } /* namespace OTest2 */
66 
67 #endif /* OTest2__INCLUDE_OTEST2_CMDSTATE_H_ */
caseordinaryptr.h
OTest2::CmdState::operator=
CmdState & operator=(const CmdState &)=delete
OTest2::CmdState::~CmdState
virtual ~CmdState()
Dtor.
Definition: cmdstate.cpp:44
OTest2::CmdState
Definition: cmdstate.h:30
OTest2::CmdState::run
virtual void run(const Context &context_)
Run the command.
Definition: cmdstate.cpp:48
command.h
OTest2::CaseOrdinaryPtr
std::shared_ptr< CaseOrdinary > CaseOrdinaryPtr
Shared pointer of the ordinary cases.
Definition: caseordinaryptr.h:27
OTest2
Definition: assertbean.h:25
OTest2::Command
generic command interface
Definition: command.h:30
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::CmdState::CmdState
CmdState(const CmdState &)=delete