diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index bd5a5f1388a..2260a4c2899 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,7 @@ #include +using namespace ProjectExplorer; using namespace Utils; namespace Autotest { @@ -340,7 +342,11 @@ void TestRunner::prepareToRunTests(TestRunMode mode) if (!projectExplorerSettings.buildBeforeDeploy || mode == TestRunMode::DebugWithoutDeploy || mode == TestRunMode::RunWithoutDeploy) { runOrDebugTests(); - } else if (project->hasActiveBuildSettings()) { + return; + } + + Target *target = project->activeTarget(); + if (target && BuildConfigurationFactory::find(target)) { buildProject(project); } else { reportResult(ResultType::MessageFatal, diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index ccf2f59247e..158863d39a2 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -249,11 +249,6 @@ Utils::FilePath Project::projectFilePath() const return document()->filePath(); } -bool Project::hasActiveBuildSettings() const -{ - return activeTarget() && BuildConfigurationFactory::find(activeTarget()); -} - void Project::addTarget(std::unique_ptr &&t) { auto pointer = t.get(); diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 4dfe1b2adc1..1af8e6c34fe 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -116,8 +116,6 @@ public: virtual ProjectNode *rootProjectNode() const; ContainerNode *containerNode() const; - bool hasActiveBuildSettings() const; - // EditorConfiguration: EditorConfiguration *editorConfiguration() const;