Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
quicktest.cpp File Reference
#include "quicktest_p.h"
#include "quicktestresult_p.h"
#include <QtTest/qtestsystem.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 <QtCore/QTranslator>
#include <QtTest/QSignalSpy>
#include <QtQml/QQmlFileSelector>
#include <private/qqmlcomponent_p.h>
#include <private/qv4resolvedtypereference_p.h>
#include "moc_quicktest_p.cpp"
+ Include dependency graph for quicktest.cpp:

Go to the source code of this file.

Classes

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 176 of file quicktest.cpp.

References QFileInfo::absoluteFilePath(), absolutePath(), QList< T >::at(), QFileInfo::baseName(), QDir::current(), e, engine, fi, i, qPrintable, qWarning, results, QList< T >::size(), 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 245 of file quicktest.cpp.

References args, QMetaObject::indexOfMethod(), QMetaObject::method(), 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 398 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 403 of file quicktest.cpp.

References QFileInfo::absoluteFilePath(), QDir::absolutePath(), app, QFileDevice::atEnd(), QFileInfo::baseName(), Qt::CaseInsensitive, QList< T >::cbegin(), QDir::cdUp(), QList< T >::cend(), QFileDevice::close(), QString::compare(), QObject::connect(), QDir::current(), QDir::currentPath(), QScopedPointer< T, Cleanup >::data(), QFileInfo::dir(), QDir::dirName(), QString::endsWith(), engine, QQuickView::engine(), QQuickView::Error, TestCaseCollector::errors(), QQuickView::errors(), QEventLoop::exec(), QFile::exists(), QFileInfo::exists(), QuickTestResult::exitCode(), fi, file, QDir::filePath(), QDir::Files, files, filters, QDirIterator::FollowSymlinks, QString::fromLocal8Bit(), QUrl::fromLocalFile(), QString::fromUtf8(), function, handleCompileErrors(), QTestRootObject::init(), QCoreApplication::installTranslator(), QTestRootObject::instance(), QCoreApplication::instance(), QSet< T >::intersects(), QFileInfo::isDir(), QString::isEmpty(), QSet< T >::isEmpty(), QList< T >::isEmpty(), QFileInfo::isFile(), iter, QTranslator::load(), QQuickView::Loading, maybeInvokeSetupMethod(), QStringView::mid(), QObject::objectName, QFile::open(), QuickTestResult::parseArgs(), 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(), QQmlFileSelector::setExtraSelectors(), QObject::setObjectName(), QuickTestResult::setProgramName(), QQuickView::setSource(), QWindow::setTitle(), QTestRootObject::setWindowShown(), QWindow::show(), SIGNAL, QTimer::singleShot, QSet< T >::size(), SLOT, QQuickView::status, stripQuotes(), QDirIterator::Subdirectories, QSet< T >::subtract(), TestCaseCollector::testCases(), QTest::testFunctions, QDir::toNativeSeparators(), QString::trimmed(), view, Qt::Window, Qt::WindowCloseButtonHint, Qt::WindowMinMaxButtonsHint, Qt::WindowSystemMenuHint, and Qt::WindowTitleHint.

Referenced by quick_test_main().

+ Here is the caller graph for this function:

◆ qWaitForSignal()

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

Definition at line 226 of file quicktest.cpp.

References QEventLoop::AllEvents, QEvent::DeferredDelete, QCoreApplication::processEvents(), QTest::qSleep(), QCoreApplication::sendPostedEvents(), signal, QList< T >::size(), spy, QTimer::start(), and timer.

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 168 of file quicktest.cpp.

References QString::mid().

Referenced by quick_test_main_with_setup().

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