MCPcopy Create free account
hub / github.com/KDE/kdevelop / testStartProcessEnv

Method testStartProcessEnv

plugins/craft/tests/test_craftruntime.cpp:149–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void 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"

Callers

nothing calls this directly

Calls 5

findExecutableFunction · 0.50
isEmptyMethod · 0.45
pathMethod · 0.45
startProcessMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected