MCPcopy Create free account
hub / github.com/IJHack/QtPass / findBinaryInPathReturnedPathIsExecutable

Method findBinaryInPathReturnedPathIsExecutable

tests/auto/util/tst_util.cpp:1301–1316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1299}
1300
1301void tst_util::findBinaryInPathReturnedPathIsExecutable() {
1302 // Verify the returned path satisfies the isExecutable() check that guards
1303 // the assignment inside the loop.
1304#ifdef Q_OS_WIN
1305 const QString binaryName = QStringLiteral("cmd.exe");
1306#else
1307 const QString binaryName = QStringLiteral("sh");
1308#endif
1309 QString result = Util::findBinaryInPath(binaryName);
1310 QVERIFY2(!result.isEmpty(), "Should find a standard shell");
1311 QFileInfo fi(result);
1312 QVERIFY2(
1313 fi.isExecutable(),
1314 qPrintable(
1315 QStringLiteral("Returned path '%1' must be executable").arg(result)));
1316}
1317
1318void tst_util::findBinaryInPathMultipleKnownBinaries() {
1319 // Test finding multiple common binaries in PATH.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected