libzypp  17.25.6
LoadTestcase.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MISC_LOADTESTCASE_H
13 #define ZYPP_MISC_LOADTESTCASE_H
14 
15 #include <zypp/Pathname.h>
16 #include <zypp/Url.h>
17 #include <zypp/base/PtrTypes.h>
18 #include <zypp/base/NonCopyable.h>
20 
21 #include <optional>
22 #include <memory>
23 
24 namespace zypp::misc::testcase {
25 
27  {
28  struct Node {
29  struct Impl;
30 
31  Node();
32  ~Node();
33  const std::string &name () const;
34  std::string &name ();
35  const std::string &value () const;
36  std::string &value ();
37 
38  const std::string &getProp( const std::string &name, const std::string &def = std::string() ) const;
39  const std::map<std::string, std::string> &properties() const;
40  std::map<std::string, std::string> &properties();
41  const std::vector<std::shared_ptr<Node>> &children() const;
42  std::vector<std::shared_ptr<Node>> &children();
43 
44  private:
46 
47  };
48 
49  TestcaseTrial();
51  const std::vector<Node> &nodes () const;
52  std::vector<Node> &nodes ();
53  private:
54  struct Impl;
56  };
57 
59  {
60  public:
61  struct Impl;
62  using TestcaseTrials = std::vector<TestcaseTrial>;
63 
64  enum Type {
67  Yaml
68  };
69 
70  LoadTestcase();
71  ~LoadTestcase();
72 
73  bool loadTestcaseAt ( const zypp::Pathname &path, std::string *err );
74  static Type testcaseTypeAt ( const zypp::Pathname &path );
75 
76  const TestcaseSetup &setupInfo() const;
77  const TestcaseTrials &trialInfo() const;
78 
79  private:
80  std::unique_ptr<Impl> _pimpl;
81  };
82 
83 }
84 
85 
86 #endif // ZYPP_MISC_LOADTESTCASE_H
zypp::misc::testcase::LoadTestcase::Type
Type
Definition: LoadTestcase.h:64
zypp::misc::testcase::TestcaseTrial::Node::properties
const std::map< std::string, std::string > & properties() const
Definition: LoadTestcase.cc:85
zypp::misc::testcase::LoadTestcase::trialInfo
const TestcaseTrials & trialInfo() const
Definition: LoadTestcase.cc:238
zypp::misc::testcase::TestcaseTrial
Definition: LoadTestcase.h:27
zypp::misc::testcase::TestcaseTrial::Node::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition: LoadTestcase.h:45
zypp::misc::testcase::TestcaseTrial::Node::children
const std::vector< std::shared_ptr< Node > > & children() const
Definition: LoadTestcase.cc:91
zypp::misc::testcase::TestcaseTrial::Node
Definition: LoadTestcase.h:28
zypp::misc::testcase::TestcaseTrial::Node::name
const std::string & name() const
Definition: LoadTestcase.cc:66
zypp::misc::testcase::LoadTestcase::Impl
Definition: LoadTestcase.cc:23
zypp::misc::testcase::LoadTestcase::setupInfo
const TestcaseSetup & setupInfo() const
Definition: LoadTestcase.cc:233
PtrTypes.h
Pathname.h
zypp::misc::testcase::TestcaseTrial::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition: LoadTestcase.h:54
zypp::misc::testcase::LoadTestcase
Definition: LoadTestcase.h:59
zypp::misc::testcase::TestcaseTrial::TestcaseTrial
TestcaseTrial()
Definition: LoadTestcase.cc:48
zypp::misc::testcase::TestcaseTrial::~TestcaseTrial
~TestcaseTrial()
Definition: LoadTestcase.cc:51
zypp::misc::testcase::TestcaseTrial::Node::value
const std::string & value() const
Definition: LoadTestcase.cc:72
Url.h
zypp::misc::testcase::LoadTestcase::LoadTestcase
LoadTestcase()
Definition: LoadTestcase.cc:195
zypp::misc::testcase::LoadTestcase::Yaml
@ Yaml
Definition: LoadTestcase.h:67
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
zypp::misc::testcase::LoadTestcase::testcaseTypeAt
static Type testcaseTypeAt(const zypp::Pathname &path)
Definition: LoadTestcase.cc:223
zypp::misc::testcase::LoadTestcase::None
@ None
Definition: LoadTestcase.h:65
zypp::misc::testcase::LoadTestcase::~LoadTestcase
~LoadTestcase()
Definition: LoadTestcase.cc:198
zypp::misc::testcase::TestcaseTrial::Node::getProp
const std::string & getProp(const std::string &name, const std::string &def=std::string()) const
Definition: LoadTestcase.cc:78
zypp::misc::testcase::TestcaseTrial::Node::~Node
~Node()
Definition: LoadTestcase.cc:63
zypp::misc::testcase::LoadTestcase::_pimpl
std::unique_ptr< Impl > _pimpl
Definition: LoadTestcase.h:80
zypp::misc::testcase::TestcaseTrial::Node::Node
Node()
Definition: LoadTestcase.cc:60
zypp::misc::testcase::LoadTestcase::TestcaseTrials
std::vector< TestcaseTrial > TestcaseTrials
Definition: LoadTestcase.h:62
TestcaseSetup.h
zypp::misc::testcase::LoadTestcase::Helix
@ Helix
Definition: LoadTestcase.h:66
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
zypp::misc::testcase::TestcaseTrial::nodes
const std::vector< Node > & nodes() const
Definition: LoadTestcase.cc:54
zypp::RWCOW_pointer< Impl >
zypp::misc::testcase::TestcaseSetup
Definition: TestcaseSetup.h:78
zypp::misc::testcase::LoadTestcase::loadTestcaseAt
bool loadTestcaseAt(const zypp::Pathname &path, std::string *err)
Definition: LoadTestcase.cc:201
zypp::misc::testcase::TestcaseTrial::Node::Impl
Definition: LoadTestcase.cc:40
zypp::misc::testcase::TestcaseTrial::Impl
Definition: LoadTestcase.cc:34
zypp::misc::testcase
Definition: LoadTestcase.cc:18
NonCopyable.h