From e5a5d38c200a33606e7f3d44603f62219f0bf63e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 23 Jan 2019 15:12:21 +0100 Subject: 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 --- src/plugins/projectexplorer/project.cpp | 18 ++++++++++++++---- 1 file 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 + #include #include 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"; -- cgit v1.2.1