forked from qt-creator/qt-creator
CMakeProjectManager: Fix initial ctest call
CMake settings can avoid to create the build directory automatically. If this is the case the ctest call fails due to missing information that is present inside the build directory. In this case we need to use the temporary directory that is used before the build directory is created. Change-Id: Ie6581e53a671c3e5ad71474d9706285d29bd37a8 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -906,11 +906,15 @@ void CMakeBuildSystem::runCTest()
|
|||||||
}
|
}
|
||||||
qCDebug(cmakeBuildSystemLog) << "Requesting ctest run after cmake run";
|
qCDebug(cmakeBuildSystemLog) << "Requesting ctest run after cmake run";
|
||||||
|
|
||||||
|
BuildDirParameters parameters(cmakeBuildConfiguration());
|
||||||
|
QTC_ASSERT(parameters.isValid(), return);
|
||||||
|
|
||||||
|
FilePath workingDirectory = workDirectory(parameters);
|
||||||
CommandLine cmd{m_ctestPath, {"-N", "--show-only=json-v1"}};
|
CommandLine cmd{m_ctestPath, {"-N", "--show-only=json-v1"}};
|
||||||
SynchronousProcess ctest;
|
SynchronousProcess ctest;
|
||||||
ctest.setTimeoutS(1);
|
ctest.setTimeoutS(1);
|
||||||
ctest.setEnvironment(cmakeBuildConfiguration()->environment().toStringList());
|
ctest.setEnvironment(cmakeBuildConfiguration()->environment().toStringList());
|
||||||
ctest.setWorkingDirectory(cmakeBuildConfiguration()->buildDirectory().toString());
|
ctest.setWorkingDirectory(workingDirectory.toString());
|
||||||
|
|
||||||
const SynchronousProcessResponse response = ctest.run(cmd);
|
const SynchronousProcessResponse response = ctest.run(cmd);
|
||||||
if (response.result == SynchronousProcessResponse::Finished) {
|
if (response.result == SynchronousProcessResponse::Finished) {
|
||||||
|
|||||||
Reference in New Issue
Block a user