aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-08-05 21:35:49 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-08-05 23:32:57 +0100
commit47cef140e8948e4668fd58fc460b264b13750698 (patch)
tree6a23c8a5d9e78d2a8819b7305fca924ed919fd93
parenta13d7d63e7c9b24f65fdcf343cbe64e8a7076087 (diff)
downloadpaludis-47cef140e8948e4668fd58fc460b264b13750698.tar.gz
paludis-47cef140e8948e4668fd58fc460b264b13750698.tar.xz
Allow TestEnvironment to take a ${ROOT}.
-rw-r--r--paludis/environments/test/test_environment.cc16
-rw-r--r--paludis/environments/test/test_environment.hh1
2 files changed, 13 insertions, 4 deletions
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index 7400022..9c6565a 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -46,18 +46,26 @@ namespace paludis
{
std::tr1::shared_ptr<PackageDatabase> package_database;
std::string paludis_command;
+ FSEntry root;
Sets sets;
- Implementation(Environment * const e) :
+ Implementation(Environment * const e, const FSEntry & r) :
package_database(new PackageDatabase(e)),
- paludis_command("")
+ paludis_command(""),
+ root(r)
{
}
};
}
TestEnvironment::TestEnvironment() :
- PrivateImplementationPattern<TestEnvironment>(new Implementation<TestEnvironment>(this)),
+ PrivateImplementationPattern<TestEnvironment>(new Implementation<TestEnvironment>(this, FSEntry("/"))),
+ _imp(PrivateImplementationPattern<TestEnvironment>::_imp)
+{
+}
+
+TestEnvironment::TestEnvironment(const FSEntry & r) :
+ PrivateImplementationPattern<TestEnvironment>(new Implementation<TestEnvironment>(this, r)),
_imp(PrivateImplementationPattern<TestEnvironment>::_imp)
{
}
@@ -150,7 +158,7 @@ TestEnvironment::reduced_gid() const
const FSEntry
TestEnvironment::root() const
{
- return FSEntry("/");
+ return _imp->root;
}
std::tr1::shared_ptr<const MirrorsSequence>
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 689c499..08d5754 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -60,6 +60,7 @@ namespace paludis
///\{
TestEnvironment();
+ TestEnvironment(const FSEntry &);
~TestEnvironment();