mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user