/**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** ** This file is part of the tools applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifdef QT_CETEST_NO_ACTIVESYNC # include "cetcpsyncconnection.h" #else # include "activesyncconnection.h" #endif const int SLEEP_AFTER_RESET = 60000; // sleep for 1 minute const int SLEEP_RECONNECT = 2000; // sleep for 2 seconds before trying another reconnect #include "deployment.h" #include #include #include #include #include #include #include using namespace std; const int debugLevel = 0; void debugOutput(const QString& text, int level) { if (level <= debugLevel) cout << qPrintable(text) << endl; } // needed for QMake sources to compile QString project_builtin_regx() { return QString();} static QString pwd; QString qmake_getpwd() { if(pwd.isNull()) pwd = QDir::currentPath(); return pwd; } bool qmake_setpwd(const QString &p) { if(QDir::setCurrent(p)) { pwd = QDir::currentPath(); return true; } return false; } namespace TestConfiguration { QString localExecutable; QString localQtConf; QString remoteTestPath; QString remoteLibraryPath; QString remoteExecutable; QString remoteResultFile; bool testDebug; void init() { testDebug = true; localQtConf = QLatin1String("no"); remoteTestPath = QLatin1String("\\Program Files\\qt_test"); remoteLibraryPath = remoteTestPath; remoteResultFile = QLatin1String("\\qt_test_results.txt"); } } void usage() { cout << "QTestLib options\n" " -functions : Returns a list of current testfunctions\n" " -xml : Outputs results as XML document\n" " -lightxml : Outputs results as stream of XML tags\n" " -o filename: Writes all output into a file\n" " -silent : Only outputs warnings and failures\n" " -v1 : Print enter messages for each testfunction\n" " -v2 : Also print out each QVERIFY/QCOMPARE/QTEST\n" " -vs : Print every signal emitted\n" " -eventdelay ms : Set default delay for mouse and keyboard simulation to ms milliseconds\n" " -keydelay ms : Set default delay for keyboard simulation to ms milliseconds\n" " -mousedelay ms : Set default delay for mouse simulation to ms milliseconds\n" " -keyevent-verbose : Turn on verbose messages for keyboard simulation\n" " -maxwarnings n : Sets the maximum amount of messages to output.\n" " 0 means unlimited, default: 2000\n" " -help : This help\n"; cout << "cetest specific options\n" " -debug : Test debug version[default]\n" " -release : Test release version\n" " -libpath : Remote path to deploy Qt libraries to\n" " -reset : Reset device before starting a test\n" " -awake : Device does not go sleep mode\n" " -qt-delete : Delete the Qt libraries after execution\n" " -project-delete : Delete the project file(s) after execution\n" " -delete : Delete everything deployed after execution\n" " -conf : Specify location of qt.conf file\n" " -f : Specify project file\n" " -cache : Specify .qmake.cache file to use\n" " -d : Increase qmake debugging \n" " -timeout : Specify a timeout value after which the test will be terminated\n" " -1 specifies waiting forever (default)\n" " 0 specifies starting the process detached\n" " >0 wait seconds\n" "\n"; } int main(int argc, char **argv) { QStringList arguments; for (int i=0; i