libzypp: zypp/misc/LoadTestcase.h Source File

libzypp 17.36.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/Globals.h>
18#include <zypp/base/PtrTypes.h>
19#include <zypp/base/NonCopyable.h>
20#include <zypp/misc/TestcaseSetup.h>
21
22#include <optional>
23#include <memory>
24
25namespace zypp::misc::testcase {
26
27 struct ZYPP_API_DEPTESTOMATIC TestcaseTrial
28 {
29 struct Node {
30 struct Impl;
31
32 Node();
33 ~Node();
34 const std::string &name () const;
35 std::string &name ();
36 const std::string &value () const;
37 std::string &value ();
38
39 const std::string &getProp( const std::string &name, const std::string &def = std::string() ) const;
40 const std::map<std::string, std::string> &properties() const;
41 std::map<std::string, std::string> &properties();
42 const std::vector<std::shared_ptr<Node>> &children() const;
43 std::vector<std::shared_ptr<Node>> &children();
44
45 private:
46 RWCOW_pointer<Impl> _pimpl;
47
48 };
49
50 TestcaseTrial();
51 ~TestcaseTrial();
52 const std::vector<Node> &nodes () const;
53 std::vector<Node> &nodes ();
54 private:
55 struct Impl;
56 RWCOW_pointer<Impl> _pimpl;
57 };
58
59 class ZYPP_API LoadTestcase : private zypp::base::NonCopyable
60 {
61 public:
62 struct Impl;
63 using TestcaseTrials = std::vector<TestcaseTrial>;
64
65 enum Type {
66 None,
67 Helix,
68 Yaml
69 };
70
71 LoadTestcase();
72 ~LoadTestcase();
73
74 bool loadTestcaseAt ( const zypp::Pathname &path, std::string *err );
75 static Type testcaseTypeAt ( const zypp::Pathname &path );
76
77 const TestcaseSetup &setupInfo() const;
78 const TestcaseTrials &trialInfo() const;
79
80 private:
81 std::unique_ptr<Impl> _pimpl;
82 };
83
84}
85
86
87#endif // ZYPP_MISC_LOADTESTCASE_H
TestcaseSetup.h
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::misc::testcase::LoadTestcase
Definition LoadTestcase.h:60
zypp::misc::testcase::LoadTestcase::LoadTestcase
LoadTestcase()
Definition LoadTestcase.cc:194
zypp::misc::testcase::LoadTestcase::_pimpl
std::unique_ptr< Impl > _pimpl
Definition LoadTestcase.h:81
zypp::misc::testcase::LoadTestcase::TestcaseTrials
std::vector< TestcaseTrial > TestcaseTrials
Definition LoadTestcase.h:63
zypp::misc::testcase::LoadTestcase::Type
Type
Definition LoadTestcase.h:65
zypp::misc::testcase::LoadTestcase::Helix
@ Helix
Definition LoadTestcase.h:67
zypp::misc::testcase::LoadTestcase::Yaml
@ Yaml
Definition LoadTestcase.h:68
zypp::misc::testcase::LoadTestcase::None
@ None
Definition LoadTestcase.h:66
zypp::misc::testcase::TestcaseSetup
Definition TestcaseSetup.h:79
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
zypp::misc::testcase
Definition LoadTestcase.cc:18
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
zypp::misc::testcase::LoadTestcase::Impl
Definition LoadTestcase.cc:23
zypp::misc::testcase::TestcaseTrial::Impl
Definition LoadTestcase.cc:34
zypp::misc::testcase::TestcaseTrial::Node::Impl
Definition LoadTestcase.cc:40
zypp::misc::testcase::TestcaseTrial::Node::children
const std::vector< std::shared_ptr< Node > > & children() const
Definition LoadTestcase.cc:90
zypp::misc::testcase::TestcaseTrial::Node::Node
Node()
Definition LoadTestcase.cc:60
zypp::misc::testcase::TestcaseTrial::Node::name
const std::string & name() const
Definition LoadTestcase.cc:66
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::properties
const std::map< std::string, std::string > & properties() const
Definition LoadTestcase.cc:84
zypp::misc::testcase::TestcaseTrial::Node::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition LoadTestcase.h:46
zypp::misc::testcase::TestcaseTrial::Node::value
const std::string & value() const
Definition LoadTestcase.cc:72
zypp::misc::testcase::TestcaseTrial::nodes
const std::vector< Node > & nodes() const
Definition LoadTestcase.cc:54
zypp::misc::testcase::TestcaseTrial::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition LoadTestcase.h:56
zypp::misc::testcase::TestcaseTrial::TestcaseTrial
TestcaseTrial()
Definition LoadTestcase.cc:48
ZYPP_API_DEPTESTOMATIC
#define ZYPP_API_DEPTESTOMATIC
Definition Globals.h:77
Globals.h
Pathname.h
Url.h
NonCopyable.h
PtrTypes.h