aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-02 14:02:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-02 14:02:30 +0000
commitcaa13048d83ccfbdc3e37dfe2e108a783bb7f866 (patch)
treea3b49c679fed9f29518ec0bc5f42935e3f4df24d
parent3c29a5803009609d21ec472c80c9866b7565ee40 (diff)
downloadpaludis-caa13048d83ccfbdc3e37dfe2e108a783bb7f866.tar.gz
paludis-caa13048d83ccfbdc3e37dfe2e108a783bb7f866.tar.xz
Add test cases for reinstall scm
-rw-r--r--paludis/dep_list/dep_list_TEST.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/paludis/dep_list/dep_list_TEST.cc b/paludis/dep_list/dep_list_TEST.cc
index 506fe8c..620d905 100644
--- a/paludis/dep_list/dep_list_TEST.cc
+++ b/paludis/dep_list/dep_list_TEST.cc
@@ -1617,5 +1617,43 @@ namespace test_cases
TEST_CHECK_EQUAL(join(d2.begin(), d2.end(), " "), "cat/two-2:0::repo cat/one-1:0::repo");
}
} test_dep_list_upgrade_as_needed;
+
+ /**
+ * \test Test DepList reinstall scm.
+ */
+ struct DepListTestCaseReinstallSCM : TestCase
+ {
+ DepListTestCaseReinstallSCM() : TestCase("dep list reinstall scm") { }
+
+ void run()
+ {
+ TestEnvironment env;
+
+ FakeRepository::Pointer repo(new FakeRepository(RepositoryName("repo")));
+ env.package_database()->add_repository(repo);
+ repo->add_version("cat", "zero", "1")->deps.build_depend_string =
+ "( cat/one cat/two cat/three-live cat/four-cvs cat/five-svn )";
+ repo->add_version("cat", "one", "scm");
+ repo->add_version("cat", "two", "2");
+ repo->add_version("cat", "three-live", "0");
+ repo->add_version("cat", "four-cvs", "0");
+ repo->add_version("cat", "five-svn", "0");
+
+ FakeInstalledRepository::Pointer installed_repo(
+ new FakeInstalledRepository(RepositoryName("installed_repo")));
+ env.package_database()->add_repository(installed_repo);
+ installed_repo->add_version("cat", "one", "scm");
+ installed_repo->add_version("cat", "two", "2");
+ installed_repo->add_version("cat", "three-live", "0");
+ installed_repo->add_version("cat", "four-cvs", "0");
+ installed_repo->add_version("cat", "five-svn", "0");
+
+ DepList d1(&env, DepListOptions());
+ d1.options.reinstall_scm = dl_reinstall_scm_always;
+ d1.add(PortageDepParser::parse("cat/zero"));
+ TEST_CHECK_EQUAL(join(d1.begin(), d1.end(), " "), "cat/one-scm:0::repo cat/two-2:0::installed_repo "
+ "cat/three-live-0:0::repo cat/four-cvs-0:0::repo cat/five-svn-0:0::repo cat/zero-1:0::repo");
+ }
+ } test_dep_list_upgrade_reinstall_scm;
}