diff options
author | dac <qt-info@nokia.com> | 2010-08-04 10:33:34 +1000 |
---|---|---|
committer | dac <qt-info@nokia.com> | 2010-08-04 10:33:34 +1000 |
commit | acce6f416c9eea7a53f62529cedd871f63e5c290 (patch) | |
tree | e6d046474e4792453feee04402296f7fca808d22 | |
parent | 566ebf5793235758f168f54c798f970bff8f8e5b (diff) | |
parent | 9923f9b3d7442e8e654ddcd3142b01d98b6a1f13 (diff) |
Merge branch 'master' of scm.dev.nokia.troll.no:research/qtuitest
-rw-r--r-- | libqsystemtest/maemotestcontrol.cpp | 17 | ||||
-rw-r--r-- | libqsystemtest/qsystemtest.cpp | 26 | ||||
-rw-r--r-- | qtuitest_config.h | 8 | ||||
-rw-r--r-- | tests/qtuitest/testapps/fileDialogSaveApp/fileDialogSaveApp.pro | 3 | ||||
-rw-r--r-- | tests/qtuitest/tst_qtuitestnamespace/tst_qtuitestnamespace.pro | 4 |
5 files changed, 49 insertions, 9 deletions
diff --git a/libqsystemtest/maemotestcontrol.cpp b/libqsystemtest/maemotestcontrol.cpp index 07e5079..074767d 100644 --- a/libqsystemtest/maemotestcontrol.cpp +++ b/libqsystemtest/maemotestcontrol.cpp @@ -3,6 +3,7 @@ #include <QTime> #include <QTimer> #include <QApplication> +#include <QDebug> namespace Core { class SshConnection; @@ -61,8 +62,19 @@ bool MaemoTestControl::startApplication( const QString &application, const QStri { Q_UNUSED(environment); Q_UNUSED(arguments); - QString cmd = "run-standalone.sh " + application; - if (styleQtUITest) cmd += " -style qtuitest"; + // for Maemo5 applications need to be run with run-standalone.sh + // however for Maemo6 we still need to set the variables + // in .profile eg DISPLAY=:0 + QString cmd = QString("( " + "if [ -x /usr/bin/run-standalone.sh ]; then " + "%1 /usr/bin/run-standalone.sh %2 %3; " + "else " + ". $HOME/.profile; " + "%1 %2 %3; " + "fi )") + .arg(environment.join(" ")) + .arg(application) + .arg(styleQtUITest?"-style qtuitest":""); runBlockingCommand( CustomCommand, cmd, 10000); reply = reply_txt; @@ -174,6 +186,7 @@ void MaemoTestControl::handleProcessFinished(int exitStatus) if (exitStatus != SshRemoteProcess::ExitedNormally || m_testProcess->exitCode() != 0) { reply_ok = false; + reply_txt += m_deviceTestOutput; reply_txt += tr("Remote process failed: %1\n") .arg(m_testProcess->errorString()); } else if (control_mode == ConfigCheck) { diff --git a/libqsystemtest/qsystemtest.cpp b/libqsystemtest/qsystemtest.cpp index 3535df2..506521b 100644 --- a/libqsystemtest/qsystemtest.cpp +++ b/libqsystemtest/qsystemtest.cpp @@ -252,8 +252,8 @@ QSystemTest::QSystemTest() , m_expect_app_close(false) { m_env.clear(); - ssh_param.host = "127.0.0.1"; - ssh_param.port = 22; + ssh_param.host = DEFAULT_AUT_HOST; + ssh_param.port = DEFAULT_AUTSSH_PORT; device_controller = 0; QTestIDE::instance()->setSystemTest(this); @@ -2235,7 +2235,10 @@ void QSystemTest::startApplication( const QString &application, const QStringLis if (!connectToAut(timeout)) { device_controller->killApplications(); - fail(QString("Could not connect to remote process '%1'.").arg(app)); + if (reply.isEmpty()) + fail(QString("Could not connect to remote process '%1'").arg(app).arg(reply)); + else + fail(QString("Could not connect to remote process '%1'\nProcess output is '%2'").arg(app).arg(reply)); } configTarget(); } @@ -2611,6 +2614,14 @@ void QSystemTest::processCommandLine( QStringList &args ) it.remove(); ssh_param.pwd = ""; ssh_param.authType = Core::SshConnectionParameters::AuthByKey; + } else if ( !arg.compare("-autsshport", Qt::CaseInsensitive) ) { + it.remove(); + if (!it.hasNext()) qFatal("Expected a value after %s", qPrintable(arg)); + bool ok; + ssh_param.port = it.next().toUShort( &ok ); + if (!ok) + qFatal("%s is not a valid port specifier", qPrintable(it.value())); + it.remove(); } else if ( !arg.compare("-autport", Qt::CaseInsensitive) ) { it.remove(); if (!it.hasNext()) qFatal("Expected a value after %s", qPrintable(arg)); @@ -2845,10 +2856,15 @@ void QSystemTest::printUsage() const qWarning( " System test options:\n" " -authost <host> : Specify the IP address or host name of the machine on which the AUT is running.\n" - " By default, the system test will connect to 127.0.0.1.\n" + " By default, the system test will connect to %s. \n" " -autport <port> : Use QTUITEST_DEFAULT_OPTIONS environment variable to specify autport option and value.\n" " Specify the port on which the AUT is listening for a system test connection.\n" " Defaults to %d. \n" + " -autsshport <port>: Specify the port to use when ssh'ing to authost.\n" + " Defaults to %d. \n" + " -username : Specify the user name when ssh'ing to authost.\n" + " -pwd : Specify the password when ssh'ing to authost.\n" + " -private-key : Specify the ssh private key when ssh'ing to authost.\n" " -keepaut : Leave the AUT running after the system test finishes.\n" " By default, if the system test launches the AUT, it will kill the AUT when testing\n" " completes.\n" @@ -2870,7 +2886,7 @@ void QSystemTest::printUsage() const " applications. For example, pass -env DISPLAY=:123 to run tested \n" " applications on a different X server.\n" " -targetID : Specify the target identifier for system under test, defaults to \'default\' or $QTUITEST_TARGETID if set\n" - , DEFAULT_AUT_PORT + , DEFAULT_AUT_HOST, DEFAULT_AUTSSH_PORT, DEFAULT_AUT_PORT ); } //#endif diff --git a/qtuitest_config.h b/qtuitest_config.h index a2959c1..cc97a4d 100644 --- a/qtuitest_config.h +++ b/qtuitest_config.h @@ -5,4 +5,12 @@ #define DEFAULT_AUT_PORT 5656 #endif +#ifndef DEFAULT_AUTSSH_PORT +#define DEFAULT_AUTSSH_PORT 22 +#endif + +#ifndef DEFAULT_AUT_HOST +#define DEFAULT_AUT_HOST "127.0.0.1" +#endif + #endif diff --git a/tests/qtuitest/testapps/fileDialogSaveApp/fileDialogSaveApp.pro b/tests/qtuitest/testapps/fileDialogSaveApp/fileDialogSaveApp.pro index cc8006e..a458154 100644 --- a/tests/qtuitest/testapps/fileDialogSaveApp/fileDialogSaveApp.pro +++ b/tests/qtuitest/testapps/fileDialogSaveApp/fileDialogSaveApp.pro @@ -6,6 +6,7 @@ TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . +INCLUDEPATH += $$SRCROOT/libqsystemtest unix:!maemo* { # avoid the need for make install on *nix DESTDIR=$$BUILDROOT/bin @@ -19,4 +20,4 @@ target.path += \ /usr/local/bin INSTALLS += \ - target
\ No newline at end of file + target diff --git a/tests/qtuitest/tst_qtuitestnamespace/tst_qtuitestnamespace.pro b/tests/qtuitest/tst_qtuitestnamespace/tst_qtuitestnamespace.pro index 79d38cf..6c5a505 100644 --- a/tests/qtuitest/tst_qtuitestnamespace/tst_qtuitestnamespace.pro +++ b/tests/qtuitest/tst_qtuitestnamespace/tst_qtuitestnamespace.pro @@ -6,6 +6,8 @@ CONFIG+=qtestlib CONFIG-=debug_and_release_target +include($$SRCROOT/libqtuitest/libqtuitest.pri) + SOURCES+= \ tst_qtuitestnamespace.cpp @@ -15,4 +17,4 @@ target.path += \ /usr/local/bin INSTALLS += \ - target
\ No newline at end of file + target |