libzypp: zypp/misc/TestcaseSetup.h Source File

libzypp 17.38.11

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