summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-01-23 15:12:21 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2019-01-24 08:39:56 +0000
commite5a5d38c200a33606e7f3d44603f62219f0bf63e (patch)
tree8261997679b40f6409c862d560bb6a98c272ad6d
parentde8ef0c0662c0e666b1aaa4b324d720fb7358288 (diff)
downloadqt-creator-e5a5d38c200a33606e7f3d44603f62219f0bf63e.tar.gz
Fix ProjectExplorerPlugin::testProject_setup()
The absolute test paths must be in the right format for the host platform, i.e. have a drive letter on Windows. Change-Id: Ibf08a9e8a8b1f9ee1bb19d5307205b53012049b5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/plugins/projectexplorer/project.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp
index 8955089275..c5195ce524 100644
--- a/src/plugins/projectexplorer/project.cpp
+++ b/src/plugins/projectexplorer/project.cpp
@@ -912,15 +912,25 @@ void Project::setPreferredKitPredicate(const Kit::Predicate &predicate)
} // namespace ProjectExplorer
+#include <utils/hostosinfo.h>
+
#include <QTest>
#include <QSignalSpy>
namespace ProjectExplorer {
-const Utils::FileName TEST_PROJECT_PATH = Utils::FileName::fromString("/tmp/foobar/baz.project");
-const Utils::FileName TEST_PROJECT_NONEXISTING_FILE = Utils::FileName::fromString("/tmp/foobar/nothing.cpp");
-const Utils::FileName TEST_PROJECT_CPP_FILE = Utils::FileName::fromString("/tmp/foobar/main.cpp");
-const Utils::FileName TEST_PROJECT_GENERATED_FILE = Utils::FileName::fromString("/tmp/foobar/generated.foo");
+static Utils::FileName constructTestPath(const char *basePath)
+{
+ Utils::FileName drive;
+ if (Utils::HostOsInfo::isWindowsHost())
+ drive = Utils::FileName::fromString("C:");
+ return drive + QLatin1String(basePath);
+}
+
+const Utils::FileName TEST_PROJECT_PATH = constructTestPath("/tmp/foobar/baz.project");
+const Utils::FileName TEST_PROJECT_NONEXISTING_FILE = constructTestPath("/tmp/foobar/nothing.cpp");
+const Utils::FileName TEST_PROJECT_CPP_FILE = constructTestPath("/tmp/foobar/main.cpp");
+const Utils::FileName TEST_PROJECT_GENERATED_FILE = constructTestPath("/tmp/foobar/generated.foo");
const QString TEST_PROJECT_MIMETYPE = "application/vnd.test.qmakeprofile";
const QString TEST_PROJECT_DISPLAYNAME = "testProjectFoo";
const char TEST_PROJECT_ID[] = "Test.Project.Id";