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/CapSet.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 CapSet &caps );
52 std::string helixXML( const Dependencies &dep );
55 std::string helixXML( const PoolItem_Ref &item );
58 ///////////////////////////////////////////////////////////////////
60 // CLASS NAME : HelixResolvable
62 * Creates a file in helix format which includes all available
63 * or installed packages,patches,selections.....
65 class HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{
68 std::string dumpFile; // Path of the generated testcase
72 HelixResolvable (const std::string & path);
75 void addResolvable (const PoolItem_Ref item);
76 std::string filename () { return dumpFile; }
79 DEFINE_PTR_TYPE(HelixResolvable);
80 typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable;
82 ///////////////////////////////////////////////////////////////////
84 // CLASS NAME : HelixControl
86 * Creates a file in helix format which contains all controll
87 * action of a testcase ( file is known as *-test.xml)
92 std::string dumpFile; // Path of the generated testcase
96 HelixControl (const std::string & controlPath,
97 const RepositoryTable & sourceTable,
98 const Arch & systemArchitecture,
99 const PoolItemList &languages,
100 const std::string & systemPath = "solver-system.xml");
104 void installResolvable (const ResObject::constPtr &resObject);
105 void lockResolvable (const ResObject::constPtr &resObject);
106 void keepResolvable (const ResObject::constPtr &resObject);
107 void deleteResolvable (const ResObject::constPtr &resObject);
108 void addDependencies (const CapSet &capRequire, const CapSet &capConflict);
109 std::string filename () { return dumpFile; }
115 ///////////////////////////////////////////////////////////////////
117 // CLASS NAME : Testcase
119 * Generating a testcase of the current pool and solver state
124 std::string dumpPath; // Path of the generated testcase
127 Testcase (const std::string & path);
131 bool createTestcase (Resolver & resolver);
136 ///////////////////////////////////////////////////////////////////
137 };// namespace detail
138 /////////////////////////////////////////////////////////////////////
139 /////////////////////////////////////////////////////////////////////
140 };// namespace solver
141 ///////////////////////////////////////////////////////////////////////
142 ///////////////////////////////////////////////////////////////////////
144 /////////////////////////////////////////////////////////////////////////
146 #endif // ZYPP_SOLVER_DETAIL_TESTCASE_H