CMakePM: Start integrating ctest

Gather some more information of a CMake based project to be
able to provide this later on to the AutoTest plugin.

Task-number: QTCREATORBUG-23332
Change-Id: I2beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-09-28 15:10:04 +02:00
parent c44e13a3f8
commit 617a8aee2b
10 changed files with 102 additions and 0 deletions

View File

@@ -192,6 +192,12 @@ CMakeConfig FileApiReader::takeParsedConfiguration(QString &errorMessage)
return cache;
}
QString FileApiReader::ctestPath() const
{
// if we failed to run cmake we should not offer ctest information either
return m_lastCMakeExitCode == 0 ? m_ctestPath : QString();
}
std::unique_ptr<CMakeProjectNode> FileApiReader::generateProjectTree(
const QList<const FileNode *> &allFiles, QString &errorMessage, bool includeHeaderNodes)
{
@@ -267,6 +273,7 @@ void FileApiReader::endState(const QFileInfo &replyFi)
m_projectParts = std::move(value->projectParts);
m_rootProjectNode = std::move(value->rootProjectNode);
m_knownHeaders = std::move(value->knownHeaders);
m_ctestPath = std::move(value->ctestPath);
if (value->errorMessage.isEmpty()) {
emit this->dataAvailable();
@@ -296,6 +303,7 @@ void FileApiReader::cmakeFinishedState(int code, QProcess::ExitStatus status)
Q_UNUSED(code)
Q_UNUSED(status)
m_lastCMakeExitCode = m_cmakeProcess->lastExitCode();
m_cmakeProcess.release()->deleteLater();
endState(FileApiParser::scanForCMakeReplyFile(m_parameters.workDirectory));