libzypp: zypp/misc/TestcaseSetup.h Source File

libzypp 17.25.10

TestcaseSetup.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #ifndef ZYPP_MISC_TESTCASESETUP_H
14 #define ZYPP_MISC_TESTCASESETUP_H
15
16 #include <zypp/Arch.h>
17 #include <zypp/Locale.h>
18 #include <zypp/Pathname.h>
19 #include <zypp/ResolverFocus.h>
20 #include <zypp/Url.h>
21 #include <zypp/base/PtrTypes.h>
22 #include <zypp/base/SetTracker.h>
23 #include <zypp/sat/Queue.h>
24 #include <zypp/target/modalias/Modalias.h>
25
26 #include <optional>
27 #include <vector>
28
29 namespace zypp {
30 class RepoManager;
31 }
32
33 namespace zypp::misc::testcase
34 {
35
36 enum class TestcaseRepoType {
37 Helix,
38 Testtags,
39 Url
40 };
41
42 struct RepoDataImpl;
43 struct ForceInstallImpl;
44 struct TestcaseSetupImpl;
45
46 class RepoData {
47 public:
48 RepoData ();
49 ~RepoData ();
50 RepoData ( RepoDataImpl &&data );
51 TestcaseRepoType type() const;
52 const std::string &alias() const;
53 uint priority() const;
54 const std::string &path() const;
55
56 const RepoDataImpl &data() const;
57 RepoDataImpl &data();
58 private:
59 RWCOW_pointer<RepoDataImpl> _pimpl;
60 };
61
62 class ForceInstall {
63 public:
64 ForceInstall ();
65 ~ForceInstall ();
66 ForceInstall ( ForceInstallImpl &&data );
67 const std::string &channel () const;
68 const std::string &package () const;
69 const std::string &kind () const;
70
71 const ForceInstallImpl &data() const;
72 ForceInstallImpl &data();
73 private:
74 RWCOW_pointer<ForceInstallImpl> _pimpl;
75 };
76
77 class TestcaseSetup
78 {
79 public:
80
81 TestcaseSetup();
82 ~TestcaseSetup();
83
84 Arch architecture () const;
85
86 const std::optional<RepoData> &systemRepo() const;
87 const std::vector<RepoData> &repos() const;
88
89 // solver flags: default to false - set true if mentioned in <setup>
90 ResolverFocus resolverFocus() const;
91
92 const Pathname &globalPath() const;
93 const Pathname &hardwareInfoFile() const;
94 const Pathname &systemCheck() const;
95
96 const target::Modalias::ModaliasList &modaliasList() const;
97 const base::SetTracker<LocaleSet> &localesTracker() const;
98 const std::vector<std::vector<std::string>> &vendorLists() const;
99 const sat::StringQueue &autoinstalled() const;
100 const std::set<std::string> &multiversionSpec() const;
101 const std::vector<ForceInstall> &forceInstallTasks() const;
102
103 bool set_licence() const;
104 bool show_mediaid() const;
105
106 bool ignorealreadyrecommended() const;
107 bool onlyRequires() const;
108 bool forceResolve() const;
109 bool cleandepsOnRemove() const;
110
111 bool allowDowngrade() const;
112 bool allowNameChange() const;
113 bool allowArchChange() const;
114 bool allowVendorChange() const;
115
116 bool dupAllowDowngrade() const;
117 bool dupAllowNameChange() const;
118 bool dupAllowArchChange() const;
119 bool dupAllowVendorChange() const;
120
121 bool applySetup ( zypp::RepoManager &manager ) const;
122
123 static bool loadRepo (zypp::RepoManager &manager, const TestcaseSetup &setup, const RepoData &data );
124
125 TestcaseSetupImpl &data();
126 const TestcaseSetupImpl &data() const;
127
128 private:
129 RWCOW_pointer<TestcaseSetupImpl> _pimpl;
130 };
131
132 }
133
134
135 #endif // ZYPP_MISC_TESTCASESETUPIMPL_H
Arch.h
Locale.h
Modalias.h
Pathname.h
PtrTypes.h
Queue.h
ResolverFocus.h
SetTracker.h
Url.h
zypp::Arch
Architecture.
Definition: Arch.h:37
zypp::RepoManager
creates and provides information about known sources.
Definition: RepoManager.h:106
zypp::Url
Url manipulation class.
Definition: Url.h:92
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
zypp::misc::testcase::ForceInstall
Definition: TestcaseSetup.h:62
zypp::misc::testcase::ForceInstall::_pimpl
RWCOW_pointer< ForceInstallImpl > _pimpl
Definition: TestcaseSetup.h:74
zypp::misc::testcase::ForceInstall::package
const std::string & package() const
Definition: TestcaseSetup.cc:50
zypp::misc::testcase::ForceInstall::kind
const std::string & kind() const
Definition: TestcaseSetup.cc:53
zypp::misc::testcase::ForceInstall::~ForceInstall
~ForceInstall()
Definition: TestcaseSetup.cc:35
zypp::misc::testcase::ForceInstall::ForceInstall
ForceInstall()
Definition: TestcaseSetup.cc:32
zypp::misc::testcase::ForceInstall::channel
const std::string & channel() const
Definition: TestcaseSetup.cc:47
zypp::misc::testcase::ForceInstall::data
const ForceInstallImpl & data() const
Definition: TestcaseSetup.cc:41
zypp::misc::testcase::RepoData
Definition: TestcaseSetup.h:46
zypp::misc::testcase::RepoData::data
const RepoDataImpl & data() const
Definition: TestcaseSetup.cc:26
zypp::misc::testcase::RepoData::~RepoData
~RepoData()
Definition: TestcaseSetup.cc:8
zypp::misc::testcase::RepoData::type
TestcaseRepoType type() const
Definition: TestcaseSetup.cc:14
zypp::misc::testcase::RepoData::priority
uint priority() const
Definition: TestcaseSetup.cc:20
zypp::misc::testcase::RepoData::RepoData
RepoData()
Definition: TestcaseSetup.cc:5
zypp::misc::testcase::RepoData::_pimpl
RWCOW_pointer< RepoDataImpl > _pimpl
Definition: TestcaseSetup.h:59
zypp::misc::testcase::RepoData::path
const std::string & path() const
Definition: TestcaseSetup.cc:23
zypp::misc::testcase::RepoData::alias
const std::string & alias() const
Definition: TestcaseSetup.cc:17
zypp::misc::testcase::TestcaseSetup
Definition: TestcaseSetup.h:78
zypp::misc::testcase::TestcaseSetup::architecture
Arch architecture() const
Definition: TestcaseSetup.cc:62
zypp::misc::testcase::TestcaseSetup::repos
const std::vector< RepoData > & repos() const
Definition: TestcaseSetup.cc:68
zypp::misc::testcase::TestcaseSetup::applySetup
bool applySetup(zypp::RepoManager &manager) const
Definition: TestcaseSetup.cc:143
zypp::misc::testcase::TestcaseSetup::resolverFocus
ResolverFocus resolverFocus() const
Definition: TestcaseSetup.cc:71
zypp::misc::testcase::TestcaseSetup::onlyRequires
bool onlyRequires() const
Definition: TestcaseSetup.cc:110
zypp::misc::testcase::TestcaseSetup::modaliasList
const target::Modalias::ModaliasList & modaliasList() const
Definition: TestcaseSetup.cc:83
zypp::misc::testcase::TestcaseSetup::forceInstallTasks
const std::vector< ForceInstall > & forceInstallTasks() const
Definition: TestcaseSetup.cc:98
zypp::misc::testcase::TestcaseSetup::systemRepo
const std::optional< RepoData > & systemRepo() const
Definition: TestcaseSetup.cc:65
zypp::misc::testcase::TestcaseSetup::vendorLists
const std::vector< std::vector< std::string > > & vendorLists() const
Definition: TestcaseSetup.cc:89
zypp::misc::testcase::TestcaseSetup::multiversionSpec
const std::set< std::string > & multiversionSpec() const
Definition: TestcaseSetup.cc:95
zypp::misc::testcase::TestcaseSetup::dupAllowVendorChange
bool dupAllowVendorChange() const
Definition: TestcaseSetup.cc:140
zypp::misc::testcase::TestcaseSetup::_pimpl
RWCOW_pointer< TestcaseSetupImpl > _pimpl
Definition: TestcaseSetup.h:129
zypp::misc::testcase::TestcaseSetup::allowNameChange
bool allowNameChange() const
Definition: TestcaseSetup.cc:122
zypp::misc::testcase::TestcaseSetup::autoinstalled
const sat::StringQueue & autoinstalled() const
Definition: TestcaseSetup.cc:92
zypp::misc::testcase::TestcaseSetup::allowDowngrade
bool allowDowngrade() const
Definition: TestcaseSetup.cc:119
zypp::misc::testcase::TestcaseSetup::loadRepo
static bool loadRepo(zypp::RepoManager &manager, const TestcaseSetup &setup, const RepoData &data)
Definition: TestcaseSetup.cc:182
zypp::misc::testcase::TestcaseSetup::systemCheck
const Pathname & systemCheck() const
Definition: TestcaseSetup.cc:80
zypp::misc::testcase::TestcaseSetup::data
TestcaseSetupImpl & data()
Definition: TestcaseSetup.cc:250
zypp::misc::testcase::TestcaseSetup::set_licence
bool set_licence() const
Definition: TestcaseSetup.cc:101
zypp::misc::testcase::TestcaseSetup::dupAllowNameChange
bool dupAllowNameChange() const
Definition: TestcaseSetup.cc:134
zypp::misc::testcase::TestcaseSetup::allowArchChange
bool allowArchChange() const
Definition: TestcaseSetup.cc:125
zypp::misc::testcase::TestcaseSetup::cleandepsOnRemove
bool cleandepsOnRemove() const
Definition: TestcaseSetup.cc:116
zypp::misc::testcase::TestcaseSetup::show_mediaid
bool show_mediaid() const
Definition: TestcaseSetup.cc:104
zypp::misc::testcase::TestcaseSetup::~TestcaseSetup
~TestcaseSetup()
Definition: TestcaseSetup.cc:59
zypp::misc::testcase::TestcaseSetup::forceResolve
bool forceResolve() const
Definition: TestcaseSetup.cc:113
zypp::misc::testcase::TestcaseSetup::globalPath
const Pathname & globalPath() const
Definition: TestcaseSetup.cc:74
zypp::misc::testcase::TestcaseSetup::hardwareInfoFile
const Pathname & hardwareInfoFile() const
Definition: TestcaseSetup.cc:77
zypp::misc::testcase::TestcaseSetup::ignorealreadyrecommended
bool ignorealreadyrecommended() const
Definition: TestcaseSetup.cc:107
zypp::misc::testcase::TestcaseSetup::allowVendorChange
bool allowVendorChange() const
Definition: TestcaseSetup.cc:128
zypp::misc::testcase::TestcaseSetup::TestcaseSetup
TestcaseSetup()
Definition: TestcaseSetup.cc:56
zypp::misc::testcase::TestcaseSetup::localesTracker
const base::SetTracker< LocaleSet > & localesTracker() const
Definition: TestcaseSetup.cc:86
zypp::misc::testcase::TestcaseSetup::dupAllowArchChange
bool dupAllowArchChange() const
Definition: TestcaseSetup.cc:137
zypp::misc::testcase::TestcaseSetup::dupAllowDowngrade
bool dupAllowDowngrade() const
Definition: TestcaseSetup.cc:131
zypp::sat::Queue
Libsolv Id queue wrapper.
Definition: Queue.h:35
zypp::target::Modalias::ModaliasList
std::vector< std::string > ModaliasList
Definition: Modalias.h:41
zypp::misc::testcase
Definition: LoadTestcase.cc:18
zypp::misc::testcase::TestcaseRepoType
TestcaseRepoType
Definition: TestcaseSetup.h:36
zypp::misc::testcase::TestcaseRepoType::Helix
@ Helix
zypp::misc::testcase::TestcaseRepoType::Testtags
@ Testtags
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::ResolverFocus
ResolverFocus
The resolvers general attitude.
Definition: ResolverFocus.h:22
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459
zypp::base::SetTracker
Track added/removed set items based on an initial set.
Definition: SetTracker.h:38
zypp::misc::testcase::ForceInstallImpl
Definition: TestcaseSetupImpl.h:34
zypp::misc::testcase::RepoDataImpl
Definition: TestcaseSetupImpl.h:25
zypp::misc::testcase::TestcaseSetupImpl
Definition: TestcaseSetupImpl.h:43