| 147 | } |
| 148 | |
| 149 | void CraftRuntimeTest::testStartProcessEnv() |
| 150 | { |
| 151 | QFETCH_GLOBAL(TempDirWrapper, runtimeInstance); |
| 152 | |
| 153 | QString printenvPath = QStandardPaths::findExecutable(QStringLiteral("printenv")); |
| 154 | if (printenvPath.isEmpty()) |
| 155 | QSKIP("Skipping startProcess() test, no \"printenv\" executable found"); |
| 156 | |
| 157 | QString printenvUnderCraftPath = runtimeInstance.path() + QStringLiteral("/bin/printenv"); |
| 158 | QVERIFY(QFile::copy(printenvPath, printenvUnderCraftPath)); |
| 159 | |
| 160 | KProcess p; |
| 161 | p.setProgram(QStringLiteral("printenv"), QStringList{QStringLiteral("PYTHONPATH")}); |
| 162 | p.setOutputChannelMode(KProcess::OnlyStdoutChannel); |
| 163 | runtimeInstance->startProcess(&p); |
| 164 | p.waitForFinished(); |
| 165 | |
| 166 | QVERIFY(p.readAllStandardOutput().contains("site-packages")); |
| 167 | } |
| 168 | |
| 169 | #include "moc_test_craftruntime.cpp" |
nothing calls this directly
no test coverage detected