1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/solver/detail/Testcase.h
13 #ifndef ZYPP_SOLVER_DETAIL_TESTCASE_H
14 #define ZYPP_SOLVER_DETAIL_TESTCASE_H
18 #include "zypp/base/ReferenceCounted.h"
19 #include "zypp/base/NonCopyable.h"
20 #include "zypp/base/PtrTypes.h"
21 #include "zypp/solver/detail/Resolver.h"
22 #include "zypp/Capabilities.h"
23 #include "zypp/ResPool.h"
24 #include "zypp/base/GzStream.h"
25 #include "zypp/Repository.h"
26 #include "zypp/Locale.h"
28 /////////////////////////////////////////////////////////////////////////
30 { ///////////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////////
33 { /////////////////////////////////////////////////////////////////////
34 /////////////////////////////////////////////////////////////////////
36 { ///////////////////////////////////////////////////////////////////
40 std::string helixXML( const T &obj ); //undefined
43 std::string helixXML( const Edition &edition );
46 std::string helixXML( const Arch &arch );
49 std::string helixXML( const Capability &cap );
52 std::string helixXML( const Capabilities &caps );
55 std::string helixXML( const CapabilitySet &caps );
58 std::string helixXML( const Dependencies &dep );
61 std::string helixXML( const PoolItem &item );
64 ///////////////////////////////////////////////////////////////////
66 // CLASS NAME : HelixResolvable
68 * Creates a file in helix format which includes all available
69 * or installed packages,patches,selections.....
71 class HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{
74 std::string dumpFile; // Path of the generated testcase
78 HelixResolvable (const std::string & path);
81 void addResolvable (const PoolItem item);
82 std::string filename () { return dumpFile; }
85 DEFINE_PTR_TYPE(HelixResolvable);
86 typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable;
88 ///////////////////////////////////////////////////////////////////
90 // CLASS NAME : HelixControl
92 * Creates a file in helix format which contains all controll
93 * action of a testcase ( file is known as *-test.xml)
98 std::string dumpFile; // Path of the generated testcase
102 HelixControl (const std::string & controlPath,
103 const RepositoryTable & sourceTable,
104 const Arch & systemArchitecture,
105 const LocaleSet &languages,
106 const std::string & systemPath = "solver-system.xml.gz");
110 void installResolvable (const ResObject::constPtr &resObject,
111 const ResStatus &status);
112 void lockResolvable (const ResObject::constPtr &resObject,
113 const ResStatus &status);
114 void keepResolvable (const ResObject::constPtr &resObject,
115 const ResStatus &status);
116 void deleteResolvable (const ResObject::constPtr &resObject,
117 const ResStatus &status);
118 void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict);
119 std::string filename () { return dumpFile; }
125 ///////////////////////////////////////////////////////////////////
127 // CLASS NAME : Testcase
129 * Generating a testcase of the current pool and solver state
134 std::string dumpPath; // Path of the generated testcase
137 Testcase (const std::string & path);
141 bool createTestcase (Resolver & resolver, bool dumpPool = true, bool runSolver = true);
142 bool createTestcasePool(const ResPool &pool);
146 ///////////////////////////////////////////////////////////////////
147 };// namespace detail
148 /////////////////////////////////////////////////////////////////////
149 /////////////////////////////////////////////////////////////////////
150 };// namespace solver
151 ///////////////////////////////////////////////////////////////////////
152 ///////////////////////////////////////////////////////////////////////
154 /////////////////////////////////////////////////////////////////////////
156 #endif // ZYPP_SOLVER_DETAIL_TESTCASE_H