diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp index 97acbb006a0..f4be94de57b 100644 --- a/src/plugins/projectexplorer/projectmanager.cpp +++ b/src/plugins/projectexplorer/projectmanager.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -786,10 +787,15 @@ void ProjectExplorerTest::testSessionSwitch() const OpenProjectResult openResult = ProjectExplorerPlugin::openProject( FilePath::fromString(sessionSpec.projectFile.fileName())); - if (openResult.errorMessage().contains("text/plain")) - QSKIP("This test requires the presence of QmakeProjectManager to be fully functional. " - "Hint: run this test with \"-load QmakeProjectManager\" option."); - QVERIFY(openResult); + if (!ProjectManager::canOpenProjectForMimeType( + Utils::mimeTypeForFile(sessionSpec.projectFile.fileName()))) { + QEXPECT_FAIL( + nullptr, + "This test requires the presence of QmakeProjectManager to be fully functional. " + "Hint: run this test with \"-load QmakeProjectManager\" option.", + Abort); + } + QVERIFY2(openResult, qPrintable(openResult.errorMessage())); QCOMPARE(openResult.projects().count(), 1); QVERIFY(openResult.project()); QCOMPARE(ProjectManager::projects().count(), 1);