39 #if QT_CONFIG(process)
41 static const QString msgProcessError(
const QProcess &process,
const QString &what)
45 << process.arguments().join(
QLatin1Char(
' ')) <<
"\": " << process.errorString();
59 process.setProcessEnvironment(env);
60 if (!workingDir.isEmpty())
61 process.setWorkingDirectory(workingDir);
63 if (!process.waitForStarted()) {
64 *errorMessage = msgProcessError(process,
"Failed to start");
67 if (!process.waitForFinished(timeOut)) {
68 *errorMessage = msgProcessError(process,
"Timed out");
70 if (!process.waitForFinished(300))
75 *stdOut = process.readAllStandardOutput();
77 *stdErr= process.readAllStandardError();
78 if (process.exitStatus() != QProcess::NormalExit) {
79 *errorMessage = msgProcessError(process,
"Crashed");
82 if (process.exitCode() != QProcess::NormalExit) {
83 *errorMessage = msgProcessError(process,
"Exit code " +
QString::number(process.exitCode()));
114 return "source_" +
name;
120 return "build_" +
name;
187 10000, &stdOut, &stdErr);
189 qDebug() <<
"macdeployqt exit OK" << exitOK;
190 qDebug() << qPrintable(stdOut);
191 qDebug() << qPrintable(stdErr);
210 env.
insert(
"DYLD_PRINT_LIBRARIES",
"true");
238 void cleanupTestCase();
244 void tst_macdeployqt::initTestCase()
247 QSKIP(
"This test requires QProcess support");
265 void tst_macdeployqt::cleanupTestCase()
271 void tst_macdeployqt::basicapp()
274 QSKIP(
"This test requires QProcess support");
291 void tst_macdeployqt::plugins_data()
293 QTest::addColumn<QString>(
"name");
298 void tst_macdeployqt::plugins()
306 if (!
run(
name, &errorMessage)) {
307 qDebug() << qPrintable(errorMessage);
308 QSKIP(
"Could not run test application before deployment");
316 #include "tst_macdeployqt.moc"
The QByteArray class provides an array of bytes.
The QDir class provides access to directory structures and their contents.
QString canonicalPath() const
static QString path(LibraryPath p)
bool startsWith(parameter_type t) const
The QObject class is the base class of all Qt objects.
The QProcessEnvironment class holds the environment variables that can be passed to a program.
void insert(const QString &name, const QString &value)
static QString findExecutable(const QString &executableName, const QStringList &paths=QStringList())
The QString class provides a Unicode character string.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLocal8Bit(QByteArrayView ba)
static QString number(int, int base=10)
The QStringList class provides a list of strings.
The QTemporaryDir class creates a unique directory for temporary use.
The QTextStream class provides a convenient interface for reading and writing text.
QList< QVariant > arguments
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
QList< QString > QStringList
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char * destination
GLsizei GLsizei GLenum void * binary
GLsizei GLsizei GLchar * source
GLsizei const GLchar *const * path
#define QTEST_MAIN(TestObject)
#define QSKIP(statement,...)
#define QFETCH(Type, name)
#define QVERIFY(statement)
#define QFINDTESTDATA(basepath)
#define QVERIFY2(statement, description)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QString sourcePath(const QString &name)
bool changeInstallName(const QString &path, const QString &binary, const QString &from, const QString &to)
bool debugDeploy(const QString &name, const QStringList &options, QString *errorMessage)
void build(const QString &name)
bool runPrintLibraries(const QString &name, QString *errorMessage, QByteArray *stdErr)
void runVerifyDeployment(const QString &name)
QTemporaryDir * g_temporaryDirectory
bool qmake(const QString &source, const QString &destination, QString *errorMessage)
bool make(const QString &destination, QString *errorMessage)
bool deploy(const QString &name, const QStringList &options, QString *errorMessage)
bool run(const QString &name, QString *errorMessage)
bool g_testDirectoryBuild
QString g_installNameToolBinary
QString g_macdeployqtBinary
QString buildPath(const QString &name)