aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 15:20:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 15:33:40 +0000
commit20d31d0ba119fe8f5a888c3b8cd53ef4b8cdd7e3 (patch)
tree850ffe237846eedb62a8e61fce1a98cff3ce151b
parentcb3b5488fe3f74a6c1f1f3044a1ae746265b930c (diff)
downloadpaludis-20d31d0ba119fe8f5a888c3b8cd53ef4b8cdd7e3.tar.gz
paludis-20d31d0ba119fe8f5a888c3b8cd53ef4b8cdd7e3.tar.xz
Test blocker targets
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc51
1 files changed, 51 insertions, 0 deletions
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index 65984b4..5e5c64c 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -191,5 +191,56 @@ namespace test_cases
}
}
} test_remove_blocker(false), test_remove_blocker_transient(true);
+
+ struct TestTargetBlocker : ResolverBlockersTestCase
+ {
+ const bool exists;
+
+ TestTargetBlocker(const bool x) :
+ ResolverBlockersTestCase("target" + std::string(x ? " exists" : "")),
+ exists(x)
+ {
+ allowed_to_remove_names->insert(QualifiedPackageName("target/target"));
+ }
+
+ void run()
+ {
+ if (exists)
+ install("target", "target", "1");
+
+ std::tr1::shared_ptr<const ResolverLists> resolutions(get_resolutions(BlockDepSpec(
+ "!target/target",
+ parse_user_package_dep_spec("target/target", &env, UserPackageDepSpecOptions()),
+ false)));
+
+ {
+ TestMessageSuffix s("taken errors");
+ check_resolution_list(resolutions->jobs(), resolutions->taken_error_job_ids(), ResolutionListChecks()
+ .finished()
+ );
+ }
+
+ {
+ TestMessageSuffix s("untaken errors");
+ check_resolution_list(resolutions->jobs(), resolutions->untaken_error_job_ids(), ResolutionListChecks()
+ .finished()
+ );
+ }
+
+ {
+ TestMessageSuffix s("ordered");
+
+ if (exists)
+ check_resolution_list(resolutions->jobs(), resolutions->taken_job_ids(), ResolutionListChecks()
+ .kind("remove_decision", QualifiedPackageName("target/target"))
+ .finished()
+ );
+ else
+ check_resolution_list(resolutions->jobs(), resolutions->taken_job_ids(), ResolutionListChecks()
+ .finished()
+ );
+ }
+ }
+ } test_target(false), test_target_exists(true);
}