Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
main.cpp File Reference
#include <QCoreApplication>
#include <QDir>
#include <QHash>
#include <QRegularExpression>
#include <QSystemSemaphore>
#include <QXmlStreamReader>
#include <algorithm>
#include <chrono>
#include <functional>
#include <thread>
#include <shellquote_shared.h>
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Classes

struct  Options
 
struct  RunnerLocker
 

Macros

#define QT_POPEN_READ   "r"
 

Functions

static bool checkJunit (const QByteArray &data)
 
static bool checkTxt (const QByteArray &data)
 
static bool checkCsv (const QByteArray &data)
 
static bool checkXml (const QByteArray &data)
 
static bool checkLightxml (const QByteArray &data)
 
static bool checkTeamcity (const QByteArray &data)
 
static bool checkTap (const QByteArray &data)
 
static bool execCommand (const QString &command, QByteArray *output=nullptr, bool verbose=false)
 
static bool parseOptions ()
 
static void printHelp ()
 
static QString packageNameFromAndroidManifest (const QString &androidManifestPath)
 
static QString activityFromAndroidManifest (const QString &androidManifestPath)
 
static void setOutputFile (QString file, QString format)
 
static bool parseTestArgs ()
 
static bool isRunning ()
 
static bool waitToFinish ()
 
static void obtainSDKVersion ()
 
static bool pullFiles ()
 
int main (int argc, char *argv[])
 [2]
 

Variables

static Options g_options
 

Macro Definition Documentation

◆ QT_POPEN_READ

#define QT_POPEN_READ   "r"

Definition at line 24 of file main.cpp.

Function Documentation

◆ activityFromAndroidManifest()

static QString activityFromAndroidManifest ( const QString androidManifestPath)
static

Definition at line 285 of file main.cpp.

References QFile::open(), QStringLiteral, and QIODeviceBase::ReadOnly.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCsv()

static bool checkCsv ( const QByteArray data)
static

Definition at line 61 of file main.cpp.

References Q_UNUSED.

◆ checkJunit()

static bool checkJunit ( const QByteArray data)
static

Definition at line 29 of file main.cpp.

References QStringLiteral.

◆ checkLightxml()

static bool checkLightxml ( const QByteArray data)
static

Definition at line 85 of file main.cpp.

References QByteArray::append(), checkXml(), and QByteArray::prepend().

+ Here is the call graph for this function:

◆ checkTap()

static bool checkTap ( const QByteArray data)
static

Definition at line 103 of file main.cpp.

References QRegularExpressionMatch::hasMatch(), and QRegularExpression::match().

+ Here is the call graph for this function:

◆ checkTeamcity()

static bool checkTeamcity ( const QByteArray data)
static

Definition at line 94 of file main.cpp.

References QList< T >::isEmpty(), and QList< T >::last().

+ Here is the call graph for this function:

◆ checkTxt()

static bool checkTxt ( const QByteArray data)
static

Definition at line 51 of file main.cpp.

References QRegularExpressionMatch::hasMatch(), and QRegularExpression::match().

+ Here is the call graph for this function:

◆ checkXml()

static bool checkXml ( const QByteArray data)
static

Definition at line 69 of file main.cpp.

References QStringLiteral.

Referenced by checkLightxml().

+ Here is the caller graph for this function:

◆ execCommand()

static bool execCommand ( const QString command,
QByteArray output = nullptr,
bool  verbose = false 
)
static

Definition at line 145 of file main.cpp.

References QByteArray::constData(), output, qPrintable, QT_POPEN_READ, and QString::toUtf8().

Referenced by isRunning(), main(), obtainSDKVersion(), pullFiles(), and waitToFinish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRunning()

static bool isRunning ( )
static

Definition at line 358 of file main.cpp.

References Options::adbCommand, arg, execCommand(), g_options, output, Options::package, QStringLiteral, shellQuote(), and QString::toUtf8().

Referenced by QLibProxyWrapper::~QLibProxyWrapper(), QQmlProfilerServiceImpl::engineAboutToBeRemoved(), QCocoaEventDispatcherPrivate::ensureNSAppInitialized(), QLibProxyWrapper::getProxies(), QIOSJumpingEventDispatcher::handleRunLoopExit(), QCocoaEventDispatcher::processEvents(), and waitToFinish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

[2]

[3]

[2]

[0]

[0] [1]

[1]

[0]

[0]

[1]

[1] [2]

[2]

[0]

[0]

[2]

[2]

[22]

[22]

[3]

[3]

[4]

[4]

[10]

[10]

[qcinfo_stream]

[qcinfo_stream]

[11]

[11]

[12]

[12]

[13]

[13]

[qcinfo_printf]

[qcinfo_printf]

[14]

[14]

[15]

[15]

[16]

[16]

[17]

[17]

[0]

[0]

[1]

[1]

[2]

[2]

[Window class using revision]

[Window class using revision]

[0]

[0]

[0]

[0]

[1]

[1]

[2]

[2]

[0]

[0]

[write output] [start stream]

[start stream]

[write element]

[write element]

[finish stream]

[finish stream] [write output]

[1]

[1]

[0]

[0]

[0]

[0] //! [1]

[1]

[0]

[0] //! [1]

[1]

[0]

[0] //! [1]

[1] //! [2]

[2]

[0]

[0]

[1]

[1]

[Adding a resource]

[Adding a resource]

[Inserting an image with a cursor]

[Inserting an image with a cursor]

[Inserting an image using HTML]

[Inserting an image using HTML]

[0]

[0] //! [1]

[1]

Definition at line 485 of file main.cpp.

References Options::activity, activityFromAndroidManifest(), Options::adbCommand, Options::apkPath, arg, Options::buildPath, execCommand(), QFile::exists(), g_options, QString::isEmpty(), lock, Options::makeCommand, obtainSDKVersion(), Options::package, packageNameFromAndroidManifest(), parseOptions(), parseTestArgs(), Options::pid, printHelp(), pullFiles(), qPrintable, QStringLiteral, Options::sdkVersion, Options::showLogcatOutput, Options::skipAddInstallRoot, Options::testArgs, QDir::toNativeSeparators(), Options::verbose, and waitToFinish().

+ Here is the call graph for this function:

◆ obtainSDKVersion()

static void obtainSDKVersion ( )
static

Definition at line 407 of file main.cpp.

References Options::adbCommand, arg, QByteArray::constData(), execCommand(), g_options, ok, output, QStringLiteral, Options::sdkVersion, QString::toUtf8(), and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ packageNameFromAndroidManifest()

static QString packageNameFromAndroidManifest ( const QString androidManifestPath)
static

Definition at line 271 of file main.cpp.

References QFile::open(), QStringLiteral, and QIODeviceBase::ReadOnly.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseOptions()

static bool parseOptions ( )
static

Definition at line 169 of file main.cpp.

References Options::activity, Options::adbCommand, Options::apkPath, argument, QCoreApplication::arguments(), arguments, QList< T >::at(), Options::buildPath, Qt::CaseInsensitive, g_options, Options::helpRequested, i, QString::isEmpty(), Options::makeCommand, qEnvironmentVariable(), QStringLiteral, Options::showLogcatOutput, QList< T >::size(), Options::skipAddInstallRoot, Options::testArgsList, Options::timeout, QVariant::toInt(), and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseTestArgs()

static bool parseTestArgs ( )
static

Definition at line 309 of file main.cpp.

References Options::activity, arg, file, g_options, i, QString::isEmpty(), QHash< Key, T >::isEmpty(), QHash< Key, T >::keys(), match(), Options::outFiles, Options::package, QStringLiteral, setOutputFile(), shellQuote(), Options::testArgs, Options::testArgsList, and QString::trimmed().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printHelp()

static void printHelp ( )
static

Definition at line 232 of file main.cpp.

References QCoreApplication::arguments(), at, and qPrintable.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pullFiles()

static bool pullFiles ( )
static

Definition at line 428 of file main.cpp.

References Options::adbCommand, arg, Options::checkFiles, QHash< Key, T >::constBegin(), QHash< Key, T >::end(), execCommand(), QHash< Key, T >::find(), QString::fromUtf8(), g_options, it, out, Options::outFiles, output, Options::package, QStringLiteral, ret, and QIODeviceBase::WriteOnly.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOutputFile()

static void setOutputFile ( QString  file,
QString  format 
)
static

Definition at line 299 of file main.cpp.

References file, g_options, Options::outFiles, and QStringLiteral.

Referenced by parseTestArgs().

+ Here is the caller graph for this function:

◆ waitToFinish()

static bool waitToFinish ( )
static

Definition at line 368 of file main.cpp.

References Options::adbCommand, arg, QByteArray::constData(), execCommand(), g_options, isRunning(), ok, output, Options::package, Options::pid, QStringLiteral, Options::sdkVersion, shellQuote(), Options::timeout, QString::toUtf8(), and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ g_options

Options g_options
static