aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/resolver_TEST_blockers.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 19:38:05 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 19:38:05 +0100
commitbad0e1b891c786bf1373194fda7bdd67af7196f2 (patch)
treef88dae3262b8200eb195f8b31636d5a473618bbe /paludis/resolver/resolver_TEST_blockers.cc
parente555408334b6179a8a7cb5efa06f5d548cc58a68 (diff)
downloadpaludis-bad0e1b891c786bf1373194fda7bdd67af7196f2.tar.gz
paludis-bad0e1b891c786bf1373194fda7bdd67af7196f2.tar.xz
Better blocker handling
Diffstat (limited to 'paludis/resolver/resolver_TEST_blockers.cc')
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc45
1 files changed, 43 insertions, 2 deletions
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index 38539b82f..0cdd1f46c 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -57,8 +57,8 @@ namespace
{
struct ResolverBlockersTestCase : ResolverTestCase
{
- ResolverBlockersTestCase(const std::string & s) :
- ResolverTestCase("blockers", s, "exheres-0", "exheres")
+ ResolverBlockersTestCase(const std::string & s, const std::string & e = "exheres-0") :
+ ResolverTestCase("blockers", s, e, "exheres")
{
}
};
@@ -232,5 +232,46 @@ namespace test_cases
test_blocked_and_dep_exists(true, false),
test_blocked_and_dep_allowed(false, true),
test_blocked_and_dep_exists_allowed(true, true);
+
+ struct BlockAndDepCycle : ResolverBlockersTestCase
+ {
+ BlockAndDepCycle() :
+ ResolverBlockersTestCase("block and dep cycle", "0")
+ {
+ install("block-and-dep-cycle", "target", "0");
+ }
+
+ void run()
+ {
+ std::tr1::shared_ptr<const Resolved> resolved(get_resolved("block-and-dep-cycle/target"));
+
+ check_resolved(resolved,
+ n::display_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .change(QualifiedPackageName("block-and-dep-cycle/dep"))
+ .change(QualifiedPackageName("block-and-dep-cycle/target"))
+ .finished()),
+ n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished())
+ );
+ }
+ } test_block_and_dep_cycle;
+
+ struct HardBlockAndDepCycle : ResolverBlockersTestCase
+ {
+ HardBlockAndDepCycle() :
+ ResolverBlockersTestCase("hard block and dep cycle", "0")
+ {
+ install("hard-block-and-dep-cycle", "target", "0");
+ }
+
+ void run()
+ {
+ TEST_CHECK_THROWS(get_resolved("hard-block-and-dep-cycle/target"), Exception);
+ }
+ } test_hard_block_and_dep_cycle;
}