Skip to content

Commit 2999f31

Browse files
committed
more test out
1 parent 3f4fc41 commit 2999f31

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/auto/autoupdatercore/UpdaterTest/installercontroller.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,27 @@ void InstallerController::createInstaller()
4444
QCOMPARE(res, 0);
4545
}
4646

47+
QString toSystemExe(QString basePath)
48+
{
49+
#if defined(Q_OS_WIN32)
50+
if(!basePath.endsWith(QStringLiteral(".exe")))
51+
return basePath + QStringLiteral(".exe");
52+
else
53+
return basePath;
54+
#elif defined(Q_OS_OSX)
55+
if(basePath.endsWith(QStringLiteral(".app")))
56+
basePath.truncate(basePath.lastIndexOf(QStringLiteral(".")));
57+
return basePath + QStringLiteral(".app/Contents/MacOS/") + QFileInfo(basePath).fileName();
58+
#elif defined(Q_OS_UNIX)
59+
return basePath;
60+
#endif
61+
}
62+
4763
void InstallerController::installLocal()
4864
{
4965
qDebug() << "Installing example";
50-
auto res = QProcess::execute(_buildDir.path() + "/QtAutoUpdaterTestInstaller", {"--script", configScript, "--verbose"});
66+
QVERIFY(QFile::exists(toSystemExe(_buildDir.path() + "/QtAutoUpdaterTestInstaller")));
67+
auto res = QProcess::execute(toSystemExe(_buildDir.path() + "/QtAutoUpdaterTestInstaller"), {"--script", configScript, "--verbose"});
5168
QCOMPARE(res, 0);
5269
}
5370

0 commit comments

Comments
 (0)