summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Jamfile.jam4
-rw-r--r--src/repo.cpp7
-rw-r--r--unittests/core.cpp18
3 files changed, 18 insertions, 11 deletions
diff --git a/src/Jamfile.jam b/src/Jamfile.jam
index db6267c..4cf083d 100644
--- a/src/Jamfile.jam
+++ b/src/Jamfile.jam
@@ -1,3 +1,5 @@
+# Testing
+path-constant gitdir : ../.git ;
lib gitfs :
[ glob *.cpp ]
@@ -6,6 +8,8 @@ lib gitfs :
<library>..//icetray
<library>..//git2
<library>..//netfs-api
+# Testing
+ <define>ROOT=\"$(gitdir)\"
: :
<library>..//netfs-api
;
diff --git a/src/repo.cpp b/src/repo.cpp
index 299f2ce..4c2a13f 100644
--- a/src/repo.cpp
+++ b/src/repo.cpp
@@ -4,9 +4,12 @@
#include "blob.h"
#include "dir.h"
+// Testing
+#include <definedDirs.h>
+
GitFS::Repo::Repo() :
- repo(Git::RepositoryOpenBare("/usr/portage/.git")),
- commit(Git::CommitLookup(repo, Git::OidParse("97a435f30472eb941f96234d274b3aeb492e2793"))),
+ repo(Git::RepositoryOpenBare(rootDir)),
+ commit(Git::CommitLookup(repo, Git::OidParse("9197cb3c6e58e6f24deb0af326f695aac87bc36d"))),
tree(Git::TreeLookup(repo, *git_commit_tree_id(commit.get())))
{
}
diff --git a/unittests/core.cpp b/unittests/core.cpp
index 9b38dfe..aad6b65 100644
--- a/unittests/core.cpp
+++ b/unittests/core.cpp
@@ -28,17 +28,17 @@ BOOST_AUTO_TEST_CASE( access )
BOOST_CHECK_EQUAL(EACCES, v->access(env, "/", W_OK));
BOOST_CHECK_EQUAL(0, v->access(env, "/", X_OK));
- BOOST_CHECK_EQUAL(0, v->access(env, "/metadata", R_OK));
- BOOST_CHECK_EQUAL(EACCES, v->access(env, "/metadata", W_OK));
- BOOST_CHECK_EQUAL(0, v->access(env, "/metadata", X_OK));
+ BOOST_CHECK_EQUAL(0, v->access(env, "/src", R_OK));
+ BOOST_CHECK_EQUAL(EACCES, v->access(env, "/src", W_OK));
+ BOOST_CHECK_EQUAL(0, v->access(env, "/src", X_OK));
- BOOST_CHECK_EQUAL(0, v->access(env, "/metadata/timestamp.chk", R_OK));
- BOOST_CHECK_EQUAL(EACCES, v->access(env, "/metadata/timestamp.chk", W_OK));
- BOOST_CHECK_EQUAL(EACCES, v->access(env, "/metadata/timestamp.chk", X_OK));
+ BOOST_CHECK_EQUAL(0, v->access(env, "/src/Jamfile.jam", R_OK));
+ BOOST_CHECK_EQUAL(EACCES, v->access(env, "/src/Jamfile.jam", W_OK));
+ BOOST_CHECK_EQUAL(EACCES, v->access(env, "/src/Jamfile.jam", X_OK));
- BOOST_CHECK_EQUAL(0, v->access(env, "/app-antivirus/skyldav/files/skyldav.initd", R_OK));
- BOOST_CHECK_EQUAL(EACCES, v->access(env, "/app-antivirus/skyldav/files/skyldav.initd", W_OK));
- BOOST_CHECK_EQUAL(0, v->access(env, "/app-antivirus/skyldav/files/skyldav.initd", X_OK));
+ BOOST_CHECK_EQUAL(0, v->access(env, "/unittests/fixtures/executable", R_OK));
+ BOOST_CHECK_EQUAL(EACCES, v->access(env, "/unittests/fixtures/executable", W_OK));
+ BOOST_CHECK_EQUAL(0, v->access(env, "/unittests/fixtures/executable", X_OK));
BOOST_CHECK_EQUAL(ENOENT, v->access(env, "/missing", R_OK));
BOOST_CHECK_EQUAL(EACCES, v->access(env, "/missing", W_OK));