aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-12 23:05:46 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-12 23:05:46 +0100
commitc01a91068caf2c6944b3191bb59951698f5f6440 (patch)
tree9b7102100be81771cdce45004412aa075f6959fe
parent5a5fec01d3b1dcaf46a025233e93bb71c435719f (diff)
downloadpaludis-c01a91068caf2c6944b3191bb59951698f5f6440.tar.gz
paludis-c01a91068caf2c6944b3191bb59951698f5f6440.tar.xz
more tests
-rw-r--r--paludis/resolver/resolver_TEST_suggestions.cc66
-rwxr-xr-xpaludis/resolver/resolver_TEST_suggestions_setup.sh42
2 files changed, 107 insertions, 1 deletions
diff --git a/paludis/resolver/resolver_TEST_suggestions.cc b/paludis/resolver/resolver_TEST_suggestions.cc
index 639d180..85426a8 100644
--- a/paludis/resolver/resolver_TEST_suggestions.cc
+++ b/paludis/resolver/resolver_TEST_suggestions.cc
@@ -288,6 +288,72 @@ namespace
namespace test_cases
{
+ struct TestSuggestion : ResolverSuggestionsTestCase
+ {
+ TestSuggestion() : ResolverSuggestionsTestCase("suggestion") { }
+
+ void run()
+ {
+ std::tr1::shared_ptr<const ResolutionLists> resolutions(get_resolutions("suggestion/target"));
+
+ {
+ TestMessageSuffix s("errors");
+ check_resolution_list(resolutions->errors(), ResolutionListChecks()
+ .finished()
+ );
+ }
+
+ {
+ TestMessageSuffix s("ordered");
+ check_resolution_list(resolutions->ordered(), ResolutionListChecks()
+ .qpn(QualifiedPackageName("suggestion/target"))
+ .finished()
+ );
+ }
+
+ {
+ TestMessageSuffix s("untaken");
+ check_resolution_list(resolutions->untaken(), ResolutionListChecks()
+ .qpn(QualifiedPackageName("suggestion/dep"))
+ .finished()
+ );
+ }
+ }
+ } test_suggestion;
+
+ struct TestUnmeetableSuggestion : ResolverSuggestionsTestCase
+ {
+ TestUnmeetableSuggestion() : ResolverSuggestionsTestCase("unmeetable suggestion") { }
+
+ void run()
+ {
+ std::tr1::shared_ptr<const ResolutionLists> resolutions(get_resolutions("unmeetable-suggestion/target"));
+
+ {
+ TestMessageSuffix s("errors");
+ check_resolution_list(resolutions->errors(), ResolutionListChecks()
+ .finished()
+ );
+ }
+
+ {
+ TestMessageSuffix s("ordered");
+ check_resolution_list(resolutions->ordered(), ResolutionListChecks()
+ .qpn(QualifiedPackageName("unmeetable-suggestion/target"))
+ .finished()
+ );
+ }
+
+ {
+ TestMessageSuffix s("untaken");
+ check_resolution_list(resolutions->untaken(), ResolutionListChecks()
+ .qpn(QualifiedPackageName("unmeetable-suggestion/unmeetable-dep"))
+ .finished()
+ );
+ }
+ }
+ } test_unmeetable_suggestion;
+
struct TestSuggestionThenDependency : ResolverSuggestionsTestCase
{
TestSuggestionThenDependency() : ResolverSuggestionsTestCase("suggestion then dependency") { }
diff --git a/paludis/resolver/resolver_TEST_suggestions_setup.sh b/paludis/resolver/resolver_TEST_suggestions_setup.sh
index d01ef46..f1dde03 100755
--- a/paludis/resolver/resolver_TEST_suggestions_setup.sh
+++ b/paludis/resolver/resolver_TEST_suggestions_setup.sh
@@ -14,8 +14,48 @@ cd repo
echo "repo" > profiles/repo_name
: > metadata/categories.conf
+# suggestion
+echo 'suggestion' >> metadata/categories.conf
+
+mkdir -p 'packages/suggestion/target'
+cat <<END > packages/suggestion/target/target-1.exheres-0
+SUMMARY="target"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="
+ ( post,suggested: suggestion/dep )
+ "
+END
+
+mkdir -p 'packages/suggestion/dep'
+cat <<END > packages/suggestion/dep/dep-1.exheres-0
+SUMMARY="dep"
+PLATFORMS="test"
+SLOT="0"
+END
+
+# unmeetable-suggestion
+echo 'unmeetable-suggestion' >> metadata/categories.conf
+
+mkdir -p 'packages/unmeetable-suggestion/target'
+cat <<END > packages/unmeetable-suggestion/target/target-1.exheres-0
+SUMMARY="target"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="
+ ( post,suggested: unmeetable-suggestion/unmeetable-dep )
+ "
+END
+
+mkdir -p 'packages/unmeetable-suggestion/unmeetable-dep'
+cat <<END > packages/unmeetable-suggestion/unmeetable-dep/unmeetable-dep-1.exheres-0
+SUMMARY="unmeetable dep"
+PLATFORMS="test"
+SLOT="0"
+END
+
# suggestion-then-dependency
-echo 'suggestion-then-dependency' > metadata/categories.conf
+echo 'suggestion-then-dependency' >> metadata/categories.conf
mkdir -p 'packages/suggestion-then-dependency/target'
cat <<END > packages/suggestion-then-dependency/target/target-1.exheres-0