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"
25 /////////////////////////////////////////////////////////////////////////
27 { ///////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////
30 { /////////////////////////////////////////////////////////////////////
31 /////////////////////////////////////////////////////////////////////
33 { ///////////////////////////////////////////////////////////////////
37 std::string helixXML( const T &obj ); //undefined
40 std::string helixXML( const Edition &edition );
43 std::string helixXML( const Arch &arch );
46 std::string helixXML( const Capability &cap );
49 std::string helixXML( const Capabilities &caps );
52 std::string helixXML( const CapabilitySet &caps );
55 std::string helixXML( const Dependencies &dep );
58 std::string helixXML( const PoolItem_Ref &item );
61 ///////////////////////////////////////////////////////////////////
63 // CLASS NAME : HelixResolvable
65 * Creates a file in helix format which includes all available
66 * or installed packages,patches,selections.....
68 class HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{
71 std::string dumpFile; // Path of the generated testcase
75 HelixResolvable (const std::string & path);
78 void addResolvable (const PoolItem_Ref item);
79 std::string filename () { return dumpFile; }
82 DEFINE_PTR_TYPE(HelixResolvable);
83 typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable;
85 ///////////////////////////////////////////////////////////////////
87 // CLASS NAME : HelixControl
89 * Creates a file in helix format which contains all controll
90 * action of a testcase ( file is known as *-test.xml)
95 std::string dumpFile; // Path of the generated testcase
99 HelixControl (const std::string & controlPath,
100 const RepositoryTable & sourceTable,
101 const Arch & systemArchitecture,
102 const PoolItemList &languages,
103 const std::string & systemPath = "solver-system.xml");
107 void installResolvable (const ResObject::constPtr &resObject);
108 void lockResolvable (const ResObject::constPtr &resObject);
109 void keepResolvable (const ResObject::constPtr &resObject);
110 void deleteResolvable (const ResObject::constPtr &resObject);
111 void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict);
112 std::string filename () { return dumpFile; }
118 ///////////////////////////////////////////////////////////////////
120 // CLASS NAME : Testcase
122 * Generating a testcase of the current pool and solver state
127 std::string dumpPath; // Path of the generated testcase
130 Testcase (const std::string & path);
134 bool createTestcase (Resolver & resolver);
139 ///////////////////////////////////////////////////////////////////
140 };// namespace detail
141 /////////////////////////////////////////////////////////////////////
142 /////////////////////////////////////////////////////////////////////
143 };// namespace solver
144 ///////////////////////////////////////////////////////////////////////
145 ///////////////////////////////////////////////////////////////////////
147 /////////////////////////////////////////////////////////////////////////
149 #endif // ZYPP_SOLVER_DETAIL_TESTCASE_H