From 61edf58c3ea5b6f0d241f18434fd3df1b38c8317 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 6 Oct 2018 16:18:39 +0200 Subject: [PATCH] Fix workingCopyPathMode --- tests/testutils.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/testutils.cpp b/tests/testutils.cpp index 0b3e630..a3a6c8f 100644 --- a/tests/testutils.cpp +++ b/tests/testutils.cpp @@ -257,7 +257,8 @@ string TestApplication::workingCopyPathMode(const string &name, WorkingCopyMode { // ensure working directory is present if (!dirExists(m_workingDir) && !makeDir(m_workingDir)) { - cerr << Phrases::Error << "Unable to create working copy for \"" << name << "\": can't create working directory." << Phrases::EndFlush; + cerr << Phrases::Error << "Unable to create working copy for \"" << name << "\": can't create working directory \"" << m_workingDir << "\"." + << Phrases::EndFlush; return string(); } @@ -274,16 +275,13 @@ string TestApplication::workingCopyPathMode(const string &name, WorkingCopyMode } currentLevel += *i; - // continue if subdirectory level already exists - if (dirExists(currentLevel)) { - continue; - } - // continue if we can successfully create the directory - if (!makeDir(currentLevel)) { + // continue if subdirectory level already exists or we can successfully create the directory + if (dirExists(currentLevel) || makeDir(currentLevel)) { continue; } // fail otherwise - cerr << Phrases::Error << "Unable to create working copy for \"" << name << "\": can't create working directory." << Phrases::EndFlush; + cerr << Phrases::Error << "Unable to create working copy for \"" << name << "\": can't create directory \"" << currentLevel + << "\" (inside working directory)." << Phrases::EndFlush; return string(); } }