Fix Git repo detection tests failing on Windows

Due to an incorrect file path - because the build path can vary,
This commit is contained in:
Oliver Hamlet
2016-03-22 20:04:16 +00:00
parent 4ab442679d
commit 61827fc914
+10 -5
View File
@@ -31,11 +31,16 @@ along with LOOT. If not, see
namespace loot {
namespace test {
#ifdef _WIN32
boost::filesystem::path parentRepoRoot = boost::filesystem::current_path().parent_path().parent_path();
#else
boost::filesystem::path parentRepoRoot = boost::filesystem::current_path().parent_path();
#endif
boost::filesystem::path getRepoRoot() {
boost::filesystem::path dir = boost::filesystem::current_path();
while (!boost::filesystem::exists(dir / ".git")) {
dir = dir.parent_path();
}
return dir;
}
boost::filesystem::path parentRepoRoot = getRepoRoot();
TEST(GitHelper, ConstructorAndDestructor) {
GitHelper * git = new GitHelper();