Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
quicktest.cpp File Reference

(0a458847e9d8dffadfbb8de349e2d26e4ce34bdb)

#include "quicktest_p.h"
#include "quicktestresult_p.h"
#include <QtTest/qtestsystem.h>
#include <QtTest/private/qtestcrashhandler_p.h>
#include "qtestoptions_p.h"
#include <QtQml/qqml.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcontext.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickwindow_p.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickwindow.h>
#include <QtQml/qjsvalue.h>
#include <QtQml/qjsengine.h>
#include <QtQml/qqmlpropertymap.h>
#include <qopengl.h>
#include <QtCore/qurl.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qdir.h>
#include <QtCore/qdiriterator.h>
#include <QtCore/qfile.h>
#include <QtCore/qdebug.h>
#include <QtCore/qeventloop.h>
#include <QtCore/qtextstream.h>
#include <QtCore/qtimer.h>
#include <QtGui/qtextdocument.h>
#include <stdio.h>
#include <QtGui/QGuiApplication>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
#include <QtCore/QTranslator>
#include <QtTest/QSignalSpy>
#include <QtQml/QQmlFileSelector>
#include <private/qqmlcomponent_p.h>
#include <private/qv4resolvedtypereference_p.h>
#include "moc_quicktest_p.cpp"
#include "quicktest.moc"
+ Include dependency graph for quicktest.cpp:

Go to the source code of this file.

Classes

class  SimpleReceiver
 
class  TestCaseCollector
 

Functions

static QString stripQuotes (const QString &s)
 
static void handleCompileErrors (const QFileInfo &fi, const QList< QQmlError > &errors, QQmlEngine *engine, QQuickView *view=nullptr)
 
bool qWaitForSignal (QObject *obj, const char *signal, int timeout)
 
template<typename... Args>
void maybeInvokeSetupMethod (QObject *setupObject, const char *member, Args &&... args)
 
int quick_test_main (int argc, char **argv, const char *name, const char *sourceDir)
 
int quick_test_main_with_setup (int argc, char **argv, const char *name, const char *sourceDir, QObject *setup)
 

Function Documentation

◆ handleCompileErrors()

static void handleCompileErrors ( const QFileInfo & fi,
const QList< QQmlError > & errors,
QQmlEngine * engine,
QQuickView * view = nullptr )
static

Definition at line 179 of file quicktest.cpp.

References absolutePath(), QDir::current(), engine, i, qPrintable, qWarning, results, str, QDir::toNativeSeparators(), and view.

Referenced by quick_test_main_with_setup().

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

◆ maybeInvokeSetupMethod()

template<typename... Args>
void maybeInvokeSetupMethod ( QObject * setupObject,
const char * member,
Args &&... args )

Definition at line 271 of file quicktest.cpp.

References args, QMetaObject::indexOfMethod(), and method.

Referenced by quick_test_main_with_setup().

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

◆ quick_test_main()

int quick_test_main ( int argc,
char ** argv,
const char * name,
const char * sourceDir )

Definition at line 427 of file quicktest.cpp.

References quick_test_main_with_setup().

+ Here is the call graph for this function:

◆ quick_test_main_with_setup()

int quick_test_main_with_setup ( int argc,
char ** argv,
const char * name,
const char * sourceDir,
QObject * setup )

Definition at line 432 of file quicktest.cpp.

References QDir::absolutePath(), app, QFileDevice::atEnd(), Qt::CaseInsensitive, QDir::cdUp(), QFileDevice::close(), QString::compare(), QObject::connect(), QDir::current(), QDir::currentPath(), QDir::dirName(), engine, QQuickView::engine(), QQuickView::Error, QQuickView::errors(), QEventLoop::exec(), QFile::exists(), QuickTestResult::exitCode(), file, QDir::Files, files, filters, QDirIterator::FollowSymlinks, QString::fromLocal8Bit(), QUrl::fromLocalFile(), QString::fromUtf8(), handleCompileErrors(), QCoreApplication::installTranslator(), QTestRootObject::instance(), QCoreApplication::instance(), iter, QQuickView::Loading, maybeInvokeSetupMethod(), QStringView::mid(), QTest::Internal::noCrashHandler, QObject::objectName, QFile::open(), QuickTestResult::parseArgs(), QGuiApplicationPrivate::platformIntegration(), QTest::CrashHandler::prepareStackTrace(), QTest::printAvailableFunctions, Q_ARG, qDebug, qPrintable, qputenv(), QStringLiteral, qUtf8Printable, QTest::qWait(), QTest::qWaitForWindowActive(), QTest::qWaitForWindowExposed(), qWarning, QIODevice::readLine(), QIODeviceBase::ReadOnly, QQuickView::rootContext(), QQmlContext::setContextProperty(), QuickTestResult::setCurrentAppname(), QObject::setObjectName(), QuickTestResult::setProgramName(), QQuickView::setSource(), QWindow::setTitle(), QWindow::show(), SIGNAL, QTimer::singleShot, SLOT, QQuickView::status, stripQuotes(), QDirIterator::Subdirectories, QTest::testFunctions, QDir::toNativeSeparators(), QString::trimmed(), view, Qt::Window, QPlatformIntegration::WindowActivation, Qt::WindowCloseButtonHint, Qt::WindowMinMaxButtonsHint, Qt::WindowSystemMenuHint, and Qt::WindowTitleHint.

Referenced by quick_test_main().

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

◆ qWaitForSignal()

bool qWaitForSignal ( QObject * obj,
const char * signal,
int timeout )

Definition at line 237 of file quicktest.cpp.

References ba, QMetaObject::connect(), QByteArray::constData(), QMetaObject::normalizedSignature(), QSIGNAL_CODE, QTest::qWaitFor(), qWarning, signal, and SimpleReceiver::signalReceived.

Referenced by QuickTestResult::waitForRendering().

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

◆ stripQuotes()

static QString stripQuotes ( const QString & s)
inlinestatic

Definition at line 171 of file quicktest.cpp.

Referenced by quick_test_main_with_setup().

+ Here is the caller graph for this function: