| 69 | } |
| 70 | |
| 71 | void ValgrindRunner::runValgrind(const QString &type) |
| 72 | { |
| 73 | if(!checkValgrindToolPath()) |
| 74 | return; |
| 75 | runBuilding(); |
| 76 | setValgrindArgs(type); |
| 77 | QProcess procValgrind; |
| 78 | connect(&procValgrind, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), |
| 79 | [&]() { |
| 80 | emit valgrindFinished(d->xmlFilePath, type); |
| 81 | }); |
| 82 | |
| 83 | connect(&procValgrind, &QProcess::readyReadStandardError, [&]() { |
| 84 | procValgrind.setReadChannel(QProcess::StandardError); |
| 85 | while (procValgrind.canReadLine()) { |
| 86 | QString line = QString::fromUtf8(procValgrind.readLine()); |
| 87 | outputMsg(line, OutputPane::OutputFormat::StdErr); |
| 88 | } |
| 89 | }); |
| 90 | |
| 91 | connect(&procValgrind, &QProcess::readyReadStandardOutput, [&]() { |
| 92 | procValgrind.setReadChannel(QProcess::StandardError); |
| 93 | while (procValgrind.canReadLine()) { |
| 94 | QString line = QString::fromUtf8(procValgrind.readLine()); |
| 95 | outputMsg(line, OutputPane::OutputFormat::StdOut); |
| 96 | } |
| 97 | }); |
| 98 | |
| 99 | procValgrind.start("valgrind", d->ValgrindArgs); |
| 100 | emit clearValgrindBar(type); |
| 101 | procValgrind.waitForFinished(-1); |
| 102 | } |
| 103 | |
| 104 | ValgrindRunner *ValgrindRunner::instance() |
| 105 | { |
no test coverage detected