mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-03 07:45:30 +08:00
qt 6.5.1 original
This commit is contained in:
12
tests/auto/testlib/CMakeLists.txt
Normal file
12
tests/auto/testlib/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
add_subdirectory(qsignalspy)
|
||||
|
||||
# QTBUG-88507
|
||||
if(QT_FEATURE_process AND NOT ANDROID)
|
||||
add_subdirectory(selftests)
|
||||
endif()
|
||||
if(TARGET Qt::Widgets)
|
||||
add_subdirectory(qabstractitemmodeltester)
|
||||
endif()
|
31
tests/auto/testlib/initmain/tst_initmain.cpp
Normal file
31
tests/auto/testlib/initmain/tst_initmain.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2019 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_InitMain : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static void initMain() { m_initMainCalled = true; }
|
||||
|
||||
private slots:
|
||||
void testcase();
|
||||
|
||||
private:
|
||||
static bool m_initMainCalled;
|
||||
};
|
||||
|
||||
bool tst_InitMain::m_initMainCalled = false;
|
||||
|
||||
void tst_InitMain::testcase()
|
||||
{
|
||||
QVERIFY(m_initMainCalled);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_InitMain)
|
||||
|
||||
#include "tst_initmain.moc"
|
46
tests/auto/testlib/outformat/tst_outformat.cpp
Normal file
46
tests/auto/testlib/outformat/tst_outformat.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2018 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
|
||||
class tst_OutFormat : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void toHex_data() const;
|
||||
void toHex() const;
|
||||
// other formats of interest ?
|
||||
};
|
||||
|
||||
void tst_OutFormat::toHex_data() const
|
||||
{
|
||||
QTest::addColumn<QByteArray>("raw");
|
||||
QTest::addColumn<QByteArray>("hex");
|
||||
|
||||
QTest::newRow("empty") << QByteArray("") << QByteArray("");
|
||||
QTest::newRow("long")
|
||||
<< QByteArray("Truncates in ellipsis when more than fifty characters long")
|
||||
<< QByteArray("54 72 75 6E 63 61 74 65 73 20 69 6E 20 65 6C 6C "
|
||||
"69 70 73 69 73 20 77 68 65 6E 20 6D 6F 72 65 20 "
|
||||
"74 68 61 6E 20 66 69 66 74 79 20 63 68 61 72 61 "
|
||||
"63 74 ...");
|
||||
QTest::newRow("spaces")
|
||||
<< QByteArray(" \t\n\v\f\r") << QByteArray("20 09 0A 0B 0C 0D");
|
||||
QTest::newRow("ASCII-escapes")
|
||||
<< QByteArray("\a\b\\\"'\177") << QByteArray("07 08 5C 22 27 7F");
|
||||
// These are the ISO Latin-15 , pound, Euro, ..., y-umlaut
|
||||
QTest::newRow("8-bit-sampler")
|
||||
<< QByteArray("\240\243\244\261\327\360\377") << QByteArray("A0 A3 A4 B1 D7 F0 FF");
|
||||
}
|
||||
|
||||
void tst_OutFormat::toHex() const
|
||||
{
|
||||
QFETCH(QByteArray, raw);
|
||||
QFETCH(QByteArray, hex);
|
||||
QScopedArrayPointer<char> repr(QTest::toHexRepresentation(raw.constData(), raw.size()));
|
||||
QCOMPARE(repr.data(), hex);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_OutFormat)
|
||||
|
||||
#include "tst_outformat.moc"
|
17
tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt
Normal file
17
tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## tst_qabstractitemmodeltester Test:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_test(tst_qabstractitemmodeltester
|
||||
SOURCES
|
||||
../../other/qabstractitemmodelutils/dynamictreemodel.cpp ../../other/qabstractitemmodelutils/dynamictreemodel.h
|
||||
tst_qabstractitemmodeltester.cpp
|
||||
INCLUDE_DIRECTORIES
|
||||
../../other/qabstractitemmodelutils
|
||||
LIBRARIES
|
||||
Qt::Gui
|
||||
Qt::Widgets
|
||||
)
|
@ -0,0 +1,292 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
#include <QAbstractItemModelTester>
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtWidgets/QtWidgets>
|
||||
|
||||
#include "dynamictreemodel.h"
|
||||
|
||||
class tst_QAbstractItemModelTester : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void stringListModel();
|
||||
void treeWidgetModel();
|
||||
void standardItemModel();
|
||||
void standardItemModelZeroColumns();
|
||||
void testInsertThroughProxy();
|
||||
void moveSourceItems();
|
||||
void testResetThroughProxy();
|
||||
};
|
||||
|
||||
/*
|
||||
tests
|
||||
*/
|
||||
|
||||
void tst_QAbstractItemModelTester::stringListModel()
|
||||
{
|
||||
QStringListModel model;
|
||||
QSortFilterProxyModel proxy;
|
||||
|
||||
QAbstractItemModelTester t1(&model);
|
||||
QAbstractItemModelTester t2(&proxy);
|
||||
|
||||
proxy.setSourceModel(&model);
|
||||
|
||||
model.setStringList(QStringList() << "2" << "3" << "1");
|
||||
model.setStringList(QStringList() << "a" << "e" << "plop" << "b" << "c");
|
||||
|
||||
proxy.setDynamicSortFilter(true);
|
||||
proxy.setFilterRegularExpression(QRegularExpression("[^b]"));
|
||||
}
|
||||
|
||||
void tst_QAbstractItemModelTester::treeWidgetModel()
|
||||
{
|
||||
QTreeWidget widget;
|
||||
|
||||
QAbstractItemModelTester t1(widget.model());
|
||||
|
||||
QTreeWidgetItem *root = new QTreeWidgetItem(&widget, QStringList("root"));
|
||||
for (int i = 0; i < 20; ++i)
|
||||
new QTreeWidgetItem(root, QStringList(QString::number(i)));
|
||||
QTreeWidgetItem *remove = root->child(2);
|
||||
root->removeChild(remove);
|
||||
QTreeWidgetItem *parent = new QTreeWidgetItem(&widget, QStringList("parent"));
|
||||
new QTreeWidgetItem(parent, QStringList("child"));
|
||||
parent->setHidden(true);
|
||||
|
||||
widget.sortByColumn(0, Qt::AscendingOrder);
|
||||
}
|
||||
|
||||
void tst_QAbstractItemModelTester::standardItemModel()
|
||||
{
|
||||
QStandardItemModel model(10, 10);
|
||||
QSortFilterProxyModel proxy;
|
||||
|
||||
QAbstractItemModelTester t1(&model);
|
||||
QAbstractItemModelTester t2(&proxy);
|
||||
|
||||
proxy.setSourceModel(&model);
|
||||
|
||||
model.insertRows(2, 5);
|
||||
model.removeRows(4, 5);
|
||||
|
||||
model.insertColumns(2, 5);
|
||||
model.removeColumns(4, 5);
|
||||
|
||||
model.insertRows(0, 5, model.index(1, 1));
|
||||
model.insertColumns(0, 5, model.index(1, 3));
|
||||
}
|
||||
|
||||
void tst_QAbstractItemModelTester::standardItemModelZeroColumns()
|
||||
{
|
||||
QStandardItemModel model;
|
||||
QAbstractItemModelTester t1(&model);
|
||||
// QTBUG-92220
|
||||
model.insertRows(0, 5);
|
||||
model.removeRows(0, 5);
|
||||
// QTBUG-92886
|
||||
model.insertRows(0, 5);
|
||||
model.removeRows(1, 2);
|
||||
|
||||
const QModelIndex parentIndex = model.index(0, 0);
|
||||
model.insertRows(0, 5, parentIndex);
|
||||
model.removeRows(1, 2, parentIndex);
|
||||
}
|
||||
|
||||
void tst_QAbstractItemModelTester::testInsertThroughProxy()
|
||||
{
|
||||
DynamicTreeModel *model = new DynamicTreeModel(this);
|
||||
|
||||
QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);
|
||||
proxy->setSourceModel(model);
|
||||
|
||||
new QAbstractItemModelTester(proxy, this);
|
||||
|
||||
ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this);
|
||||
insertCommand->setNumCols(4);
|
||||
insertCommand->setStartRow(0);
|
||||
insertCommand->setEndRow(9);
|
||||
// Parent is QModelIndex()
|
||||
insertCommand->doCommand();
|
||||
|
||||
insertCommand = new ModelInsertCommand(model, this);
|
||||
insertCommand->setNumCols(4);
|
||||
insertCommand->setAncestorRowNumbers(QList<int>() << 5);
|
||||
insertCommand->setStartRow(0);
|
||||
insertCommand->setEndRow(9);
|
||||
insertCommand->doCommand();
|
||||
|
||||
ModelMoveCommand *moveCommand = new ModelMoveCommand(model, this);
|
||||
moveCommand->setNumCols(4);
|
||||
moveCommand->setStartRow(0);
|
||||
moveCommand->setEndRow(0);
|
||||
moveCommand->setDestRow(9);
|
||||
moveCommand->setDestAncestors(QList<int>() << 5);
|
||||
moveCommand->doCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
Makes the persistent index list publicly accessible
|
||||
*/
|
||||
class AccessibleProxyModel : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AccessibleProxyModel(QObject *parent = nullptr) : QSortFilterProxyModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QModelIndexList persistent()
|
||||
{
|
||||
return persistentIndexList();
|
||||
}
|
||||
};
|
||||
|
||||
class ObservingObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ObservingObject(AccessibleProxyModel *proxy, QObject *parent = nullptr) :
|
||||
QObject(parent),
|
||||
m_proxy(proxy),
|
||||
storePersistentFailureCount(0),
|
||||
checkPersistentFailureCount(0)
|
||||
{
|
||||
connect(m_proxy, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
|
||||
SLOT(storePersistent()));
|
||||
connect(m_proxy, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
|
||||
SLOT(checkPersistent()));
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
||||
void storePersistent(const QModelIndex &parent)
|
||||
{
|
||||
for (int row = 0; row < m_proxy->rowCount(parent); ++row) {
|
||||
QModelIndex proxyIndex = m_proxy->index(row, 0, parent);
|
||||
QModelIndex sourceIndex = m_proxy->mapToSource(proxyIndex);
|
||||
if (!proxyIndex.isValid()) {
|
||||
qWarning("%s: Invalid proxy index", Q_FUNC_INFO);
|
||||
++storePersistentFailureCount;
|
||||
}
|
||||
if (!sourceIndex.isValid()) {
|
||||
qWarning("%s: invalid source index", Q_FUNC_INFO);
|
||||
++storePersistentFailureCount;
|
||||
}
|
||||
m_persistentSourceIndexes.append(sourceIndex);
|
||||
m_persistentProxyIndexes.append(proxyIndex);
|
||||
if (m_proxy->hasChildren(proxyIndex))
|
||||
storePersistent(proxyIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void storePersistent()
|
||||
{
|
||||
// This method is called from rowsAboutToBeMoved. Persistent indexes should be valid
|
||||
foreach (const QModelIndex &idx, m_persistentProxyIndexes)
|
||||
if (!idx.isValid()) {
|
||||
qWarning("%s: persistentProxyIndexes contains invalid index", Q_FUNC_INFO);
|
||||
++storePersistentFailureCount;
|
||||
}
|
||||
|
||||
if (!m_proxy->persistent().isEmpty()) {
|
||||
qWarning("%s: proxy should have no persistent indexes when storePersistent called",
|
||||
Q_FUNC_INFO);
|
||||
++storePersistentFailureCount;
|
||||
}
|
||||
storePersistent(QModelIndex());
|
||||
if (m_proxy->persistent().isEmpty()) {
|
||||
qWarning("%s: proxy should have persistent index after storePersistent called",
|
||||
Q_FUNC_INFO);
|
||||
++storePersistentFailureCount;
|
||||
}
|
||||
}
|
||||
|
||||
void checkPersistent()
|
||||
{
|
||||
for (int row = 0; row < m_persistentProxyIndexes.size(); ++row) {
|
||||
m_persistentProxyIndexes.at(row);
|
||||
m_persistentSourceIndexes.at(row);
|
||||
}
|
||||
for (int row = 0; row < m_persistentProxyIndexes.size(); ++row) {
|
||||
QModelIndex updatedProxy = m_persistentProxyIndexes.at(row);
|
||||
QModelIndex updatedSource = m_persistentSourceIndexes.at(row);
|
||||
if (m_proxy->mapToSource(updatedProxy) != updatedSource) {
|
||||
qWarning("%s: check failed at row %d", Q_FUNC_INFO, row);
|
||||
++checkPersistentFailureCount;
|
||||
}
|
||||
}
|
||||
m_persistentSourceIndexes.clear();
|
||||
m_persistentProxyIndexes.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
AccessibleProxyModel *m_proxy;
|
||||
QList<QPersistentModelIndex> m_persistentSourceIndexes;
|
||||
QList<QPersistentModelIndex> m_persistentProxyIndexes;
|
||||
public:
|
||||
int storePersistentFailureCount;
|
||||
int checkPersistentFailureCount;
|
||||
};
|
||||
|
||||
void tst_QAbstractItemModelTester::moveSourceItems()
|
||||
{
|
||||
DynamicTreeModel *model = new DynamicTreeModel(this);
|
||||
AccessibleProxyModel *proxy = new AccessibleProxyModel(this);
|
||||
proxy->setSourceModel(model);
|
||||
|
||||
ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this);
|
||||
insertCommand->setStartRow(0);
|
||||
insertCommand->setEndRow(2);
|
||||
insertCommand->doCommand();
|
||||
|
||||
insertCommand = new ModelInsertCommand(model, this);
|
||||
insertCommand->setAncestorRowNumbers(QList<int>() << 1);
|
||||
insertCommand->setStartRow(0);
|
||||
insertCommand->setEndRow(2);
|
||||
insertCommand->doCommand();
|
||||
|
||||
ObservingObject observer(proxy);
|
||||
|
||||
ModelMoveCommand *moveCommand = new ModelMoveCommand(model, this);
|
||||
moveCommand->setStartRow(0);
|
||||
moveCommand->setEndRow(0);
|
||||
moveCommand->setDestAncestors(QList<int>() << 1);
|
||||
moveCommand->setDestRow(0);
|
||||
moveCommand->doCommand();
|
||||
|
||||
QCOMPARE(observer.storePersistentFailureCount, 0);
|
||||
QCOMPARE(observer.checkPersistentFailureCount, 0);
|
||||
}
|
||||
|
||||
void tst_QAbstractItemModelTester::testResetThroughProxy()
|
||||
{
|
||||
DynamicTreeModel *model = new DynamicTreeModel(this);
|
||||
|
||||
ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this);
|
||||
insertCommand->setStartRow(0);
|
||||
insertCommand->setEndRow(2);
|
||||
insertCommand->doCommand();
|
||||
|
||||
QPersistentModelIndex persistent = model->index(0, 0);
|
||||
|
||||
AccessibleProxyModel *proxy = new AccessibleProxyModel(this);
|
||||
proxy->setSourceModel(model);
|
||||
|
||||
ObservingObject observer(proxy);
|
||||
observer.storePersistent();
|
||||
|
||||
ModelResetCommand *resetCommand = new ModelResetCommand(model, this);
|
||||
resetCommand->setNumCols(0);
|
||||
resetCommand->doCommand();
|
||||
|
||||
QCOMPARE(observer.storePersistentFailureCount, 0);
|
||||
QCOMPARE(observer.checkPersistentFailureCount, 0);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QAbstractItemModelTester)
|
||||
#include "tst_qabstractitemmodeltester.moc"
|
11
tests/auto/testlib/qsignalspy/CMakeLists.txt
Normal file
11
tests/auto/testlib/qsignalspy/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## tst_qsignalspy Test:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_test(tst_qsignalspy
|
||||
SOURCES
|
||||
tst_qsignalspy.cpp
|
||||
)
|
489
tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
Normal file
489
tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
Normal file
@ -0,0 +1,489 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QTest>
|
||||
#include <QSignalSpy>
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
#include <qdatetime.h>
|
||||
|
||||
class tst_QSignalSpy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigFoo();
|
||||
|
||||
private slots:
|
||||
void spyWithoutArgs();
|
||||
void spyWithBasicArgs();
|
||||
void spyWithPointers();
|
||||
void spyWithQtClasses();
|
||||
void spyWithBasicQtClasses();
|
||||
void spyWithQtTypedefs();
|
||||
|
||||
void wait_signalEmitted();
|
||||
void wait_timeout();
|
||||
void wait_signalEmittedLater();
|
||||
void wait_signalEmittedTooLate();
|
||||
void wait_signalEmittedMultipleTimes();
|
||||
|
||||
void spyFunctionPointerWithoutArgs();
|
||||
void spyFunctionPointerWithBasicArgs();
|
||||
void spyFunctionPointerWithPointers();
|
||||
void spyFunctionPointerWithQtClasses();
|
||||
void spyFunctionPointerWithCustomClass();
|
||||
void spyFunctionPointerWithBasicQtClasses();
|
||||
void spyFunctionPointerWithQtTypedefs();
|
||||
|
||||
void waitFunctionPointer_signalEmitted();
|
||||
void waitFunctionPointer_timeout();
|
||||
void waitFunctionPointer_signalEmittedLater();
|
||||
void waitFunctionPointer_signalEmittedTooLate();
|
||||
void waitFunctionPointer_signalEmittedMultipleTimes();
|
||||
|
||||
void spyOnMetaMethod();
|
||||
|
||||
void spyOnMetaMethod_invalid();
|
||||
void spyOnMetaMethod_invalid_data();
|
||||
};
|
||||
|
||||
struct CustomType {};
|
||||
|
||||
class QtTestObject: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtTestObject();
|
||||
|
||||
signals:
|
||||
void sig0();
|
||||
void sig1(int, int);
|
||||
void sigLong(long, long);
|
||||
void sig2(int *, int *);
|
||||
|
||||
public:
|
||||
QString slotResult;
|
||||
friend class tst_QSignalSpy;
|
||||
};
|
||||
|
||||
QtTestObject::QtTestObject()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyWithoutArgs()
|
||||
{
|
||||
QtTestObject obj;
|
||||
|
||||
QSignalSpy spy(&obj, SIGNAL(sig0()));
|
||||
QCOMPARE(spy.size(), 0);
|
||||
|
||||
emit obj.sig0();
|
||||
QCOMPARE(spy.size(), 1);
|
||||
emit obj.sig0();
|
||||
QCOMPARE(spy.size(), 2);
|
||||
|
||||
QList<QVariant> args = spy.takeFirst();
|
||||
QCOMPARE(args.size(), 0);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyWithBasicArgs()
|
||||
{
|
||||
QtTestObject obj;
|
||||
QSignalSpy spy(&obj, SIGNAL(sig1(int,int)));
|
||||
|
||||
emit obj.sig1(1, 2);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
|
||||
QList<QVariant> args = spy.takeFirst();
|
||||
QCOMPARE(args.size(), 2);
|
||||
QCOMPARE(args.at(0).toInt(), 1);
|
||||
QCOMPARE(args.at(1).toInt(), 2);
|
||||
|
||||
QSignalSpy spyl(&obj, SIGNAL(sigLong(long,long)));
|
||||
|
||||
emit obj.sigLong(1l, 2l);
|
||||
args = spyl.takeFirst();
|
||||
QCOMPARE(args.size(), 2);
|
||||
QCOMPARE(qvariant_cast<long>(args.at(0)), 1l);
|
||||
QCOMPARE(qvariant_cast<long>(args.at(1)), 2l);
|
||||
}
|
||||
|
||||
|
||||
void tst_QSignalSpy::spyWithPointers()
|
||||
{
|
||||
qRegisterMetaType<int *>("int*");
|
||||
|
||||
QtTestObject obj;
|
||||
QSignalSpy spy(&obj, SIGNAL(sig2(int*,int*)));
|
||||
|
||||
int i1 = 1;
|
||||
int i2 = 2;
|
||||
|
||||
emit obj.sig2(&i1, &i2);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
|
||||
QList<QVariant> args = spy.takeFirst();
|
||||
QCOMPARE(args.size(), 2);
|
||||
QCOMPARE(*static_cast<int * const *>(args.at(0).constData()), &i1);
|
||||
QCOMPARE(*static_cast<int * const *>(args.at(1).constData()), &i2);
|
||||
}
|
||||
|
||||
struct CustomType2;
|
||||
|
||||
class QtTestObject2: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class tst_QSignalSpy;
|
||||
|
||||
signals:
|
||||
void sig(QString);
|
||||
void sig2(const QDateTime &dt);
|
||||
void sig3(QObject *o);
|
||||
void sig4(QChar c);
|
||||
void sig5(const QVariant &v);
|
||||
void sig6(CustomType );
|
||||
void sig7(CustomType2 *);
|
||||
};
|
||||
|
||||
void tst_QSignalSpy::spyWithBasicQtClasses()
|
||||
{
|
||||
QtTestObject2 obj;
|
||||
|
||||
QSignalSpy spy(&obj, SIGNAL(sig(QString)));
|
||||
emit obj.sig(QString("bubu"));
|
||||
QCOMPARE(spy.size(), 1);
|
||||
QCOMPARE(spy.at(0).size(), 1);
|
||||
QCOMPARE(spy.at(0).at(0).toString(), QString("bubu"));
|
||||
|
||||
QSignalSpy spy2(&obj, SIGNAL(sig5(QVariant)));
|
||||
QVariant val(45);
|
||||
emit obj.sig5(val);
|
||||
QCOMPARE(spy2.size(), 1);
|
||||
QCOMPARE(spy2.at(0).size(), 1);
|
||||
QCOMPARE(spy2.at(0).at(0), val);
|
||||
QCOMPARE(qvariant_cast<QVariant>(spy2.at(0).at(0)), val);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyWithQtClasses()
|
||||
{
|
||||
QtTestObject2 obj;
|
||||
|
||||
|
||||
QSignalSpy spy(&obj, SIGNAL(sig2(QDateTime)));
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
emit obj.sig2(dt);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
QCOMPARE(spy.at(0).size(), 1);
|
||||
QCOMPARE(spy.at(0).at(0).typeName(), "QDateTime");
|
||||
QCOMPARE(*static_cast<const QDateTime *>(spy.at(0).at(0).constData()), dt);
|
||||
QCOMPARE(spy.at(0).at(0).toDateTime(), dt);
|
||||
|
||||
QSignalSpy spy2(&obj, SIGNAL(sig3(QObject*)));
|
||||
emit obj.sig3(this);
|
||||
QCOMPARE(*static_cast<QObject * const *>(spy2.value(0).value(0).constData()),
|
||||
(QObject *)this);
|
||||
QCOMPARE(qvariant_cast<QObject *>(spy2.value(0).value(0)), (QObject*)this);
|
||||
|
||||
QSignalSpy spy3(&obj, SIGNAL(sig4(QChar)));
|
||||
emit obj.sig4(QChar('A'));
|
||||
QCOMPARE(qvariant_cast<QChar>(spy3.value(0).value(0)), QChar('A'));
|
||||
}
|
||||
|
||||
class QtTestObject3: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class tst_QSignalSpy;
|
||||
|
||||
signals:
|
||||
void sig1(quint16);
|
||||
void sig2(qlonglong, qulonglong);
|
||||
void sig3(qint64, quint64);
|
||||
};
|
||||
|
||||
void tst_QSignalSpy::spyWithQtTypedefs()
|
||||
{
|
||||
QtTestObject3 obj;
|
||||
|
||||
// QSignalSpy spy1(&obj, SIGNAL(sig1(quint16)));
|
||||
// emit obj.sig1(42);
|
||||
// QCOMPARE(spy1.value(0).value(0).toInt(), 42);
|
||||
|
||||
QSignalSpy spy2(&obj, SIGNAL(sig2(qlonglong,qulonglong)));
|
||||
emit obj.sig2(42, 43);
|
||||
QCOMPARE(spy2.value(0).value(0).toInt(), 42);
|
||||
QCOMPARE(spy2.value(0).value(1).toInt(), 43);
|
||||
|
||||
// QSignalSpy spy3(&obj, SIGNAL(sig3(qint64,quint64)));
|
||||
// emit obj.sig3(44, 45);
|
||||
// QCOMPARE(spy3.value(0).value(0).toInt(), 44);
|
||||
// QCOMPARE(spy3.value(0).value(1).toInt(), 45);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::wait_signalEmitted()
|
||||
{
|
||||
QTimer::singleShot(0, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, SIGNAL(sigFoo()));
|
||||
QVERIFY(spy.wait(1));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::wait_timeout()
|
||||
{
|
||||
QSignalSpy spy(this, SIGNAL(sigFoo()));
|
||||
QVERIFY(!spy.wait(1));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::wait_signalEmittedLater()
|
||||
{
|
||||
QTimer::singleShot(500, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, SIGNAL(sigFoo()));
|
||||
QVERIFY(spy.wait(1000));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::wait_signalEmittedTooLate()
|
||||
{
|
||||
QTimer::singleShot(500, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, SIGNAL(sigFoo()));
|
||||
QVERIFY(!spy.wait(200));
|
||||
QTRY_COMPARE(spy.size(), 1);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::wait_signalEmittedMultipleTimes()
|
||||
{
|
||||
QTimer::singleShot(100, this, SIGNAL(sigFoo()));
|
||||
QTimer::singleShot(800, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, SIGNAL(sigFoo()));
|
||||
QVERIFY(spy.wait());
|
||||
QCOMPARE(spy.size(), 1); // we don't wait for the second signal...
|
||||
QVERIFY(spy.wait());
|
||||
QCOMPARE(spy.size(), 2);
|
||||
QVERIFY(!spy.wait(1));
|
||||
QTimer::singleShot(10, this, SIGNAL(sigFoo()));
|
||||
QVERIFY(spy.wait());
|
||||
QCOMPARE(spy.size(), 3);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithoutArgs()
|
||||
{
|
||||
QtTestObject obj;
|
||||
|
||||
QSignalSpy spy(&obj, &QtTestObject::sig0);
|
||||
QCOMPARE(spy.size(), 0);
|
||||
|
||||
emit obj.sig0();
|
||||
QCOMPARE(spy.size(), 1);
|
||||
emit obj.sig0();
|
||||
QCOMPARE(spy.size(), 2);
|
||||
|
||||
QList<QVariant> args = spy.takeFirst();
|
||||
QCOMPARE(args.size(), 0);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithBasicArgs()
|
||||
{
|
||||
QtTestObject obj;
|
||||
QSignalSpy spy(&obj, &QtTestObject::sig1);
|
||||
|
||||
emit obj.sig1(1, 2);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
|
||||
QList<QVariant> args = spy.takeFirst();
|
||||
QCOMPARE(args.size(), 2);
|
||||
QCOMPARE(args.at(0).toInt(), 1);
|
||||
QCOMPARE(args.at(1).toInt(), 2);
|
||||
|
||||
QSignalSpy spyl(&obj, &QtTestObject::sigLong);
|
||||
|
||||
emit obj.sigLong(1l, 2l);
|
||||
args = spyl.takeFirst();
|
||||
QCOMPARE(args.size(), 2);
|
||||
QCOMPARE(qvariant_cast<long>(args.at(0)), 1l);
|
||||
QCOMPARE(qvariant_cast<long>(args.at(1)), 2l);
|
||||
}
|
||||
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithPointers()
|
||||
{
|
||||
qRegisterMetaType<int *>("int*");
|
||||
|
||||
QtTestObject obj;
|
||||
QSignalSpy spy(&obj, &QtTestObject::sig2);
|
||||
|
||||
int i1 = 1;
|
||||
int i2 = 2;
|
||||
|
||||
emit obj.sig2(&i1, &i2);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
|
||||
QList<QVariant> args = spy.takeFirst();
|
||||
QCOMPARE(args.size(), 2);
|
||||
QCOMPARE(*static_cast<int * const *>(args.at(0).constData()), &i1);
|
||||
QCOMPARE(*static_cast<int * const *>(args.at(1).constData()), &i2);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithBasicQtClasses()
|
||||
{
|
||||
QtTestObject2 obj;
|
||||
|
||||
QSignalSpy spy(&obj, &QtTestObject2::sig);
|
||||
emit obj.sig(QString("bubu"));
|
||||
QCOMPARE(spy.size(), 1);
|
||||
QCOMPARE(spy.at(0).size(), 1);
|
||||
QCOMPARE(spy.at(0).at(0).toString(), QString("bubu"));
|
||||
|
||||
QSignalSpy spy2(&obj, &QtTestObject2::sig5);
|
||||
QVariant val(45);
|
||||
emit obj.sig5(val);
|
||||
QCOMPARE(spy2.size(), 1);
|
||||
QCOMPARE(spy2.at(0).size(), 1);
|
||||
QCOMPARE(spy2.at(0).at(0), val);
|
||||
QCOMPARE(qvariant_cast<QVariant>(spy2.at(0).at(0)), val);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithQtClasses()
|
||||
{
|
||||
QtTestObject2 obj;
|
||||
|
||||
QSignalSpy spy(&obj, &QtTestObject2::sig2);
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
emit obj.sig2(dt);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
QCOMPARE(spy.at(0).size(), 1);
|
||||
QCOMPARE(spy.at(0).at(0).typeName(), "QDateTime");
|
||||
QCOMPARE(*static_cast<const QDateTime *>(spy.at(0).at(0).constData()), dt);
|
||||
QCOMPARE(spy.at(0).at(0).toDateTime(), dt);
|
||||
|
||||
QSignalSpy spy2(&obj, &QtTestObject2::sig3);
|
||||
emit obj.sig3(this);
|
||||
QCOMPARE(*static_cast<QObject * const *>(spy2.value(0).value(0).constData()),
|
||||
(QObject *)this);
|
||||
QCOMPARE(qvariant_cast<QObject *>(spy2.value(0).value(0)), (QObject*)this);
|
||||
|
||||
QSignalSpy spy3(&obj, &QtTestObject2::sig4);
|
||||
emit obj.sig4(QChar('A'));
|
||||
QCOMPARE(qvariant_cast<QChar>(spy3.value(0).value(0)), QChar('A'));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithCustomClass()
|
||||
{
|
||||
QtTestObject2 obj;
|
||||
{
|
||||
QSignalSpy spy(&obj, &QtTestObject2::sig6);
|
||||
emit obj.sig6({});
|
||||
QCOMPARE(spy.size(), 1);
|
||||
QCOMPARE(spy.at(0).size(), 1);
|
||||
QCOMPARE(spy.at(0).at(0).typeName(), "CustomType");
|
||||
}
|
||||
|
||||
{
|
||||
QTest::ignoreMessage(QtMsgType::QtWarningMsg, "QSignalSpy: Unable to handle parameter '' of type 'CustomType2*' of method 'sig7', use qRegisterMetaType to register it.");
|
||||
QSignalSpy spy(&obj, &QtTestObject2::sig7);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyFunctionPointerWithQtTypedefs()
|
||||
{
|
||||
QtTestObject3 obj;
|
||||
|
||||
QSignalSpy spy2(&obj, &QtTestObject3::sig2);
|
||||
emit obj.sig2(42, 43);
|
||||
QCOMPARE(spy2.value(0).value(0).toInt(), 42);
|
||||
QCOMPARE(spy2.value(0).value(1).toInt(), 43);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::waitFunctionPointer_signalEmitted()
|
||||
{
|
||||
QTimer::singleShot(0, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, &tst_QSignalSpy::sigFoo);
|
||||
QVERIFY(spy.wait(1));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::waitFunctionPointer_timeout()
|
||||
{
|
||||
QSignalSpy spy(this, &tst_QSignalSpy::sigFoo);
|
||||
QVERIFY(!spy.wait(1));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::waitFunctionPointer_signalEmittedLater()
|
||||
{
|
||||
QTimer::singleShot(500, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, &tst_QSignalSpy::sigFoo);
|
||||
QVERIFY(spy.wait(1000));
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::waitFunctionPointer_signalEmittedTooLate()
|
||||
{
|
||||
QTimer::singleShot(500, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, &tst_QSignalSpy::sigFoo);
|
||||
QVERIFY(!spy.wait(200));
|
||||
QTest::qWait(400);
|
||||
QCOMPARE(spy.size(), 1);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::waitFunctionPointer_signalEmittedMultipleTimes()
|
||||
{
|
||||
QTimer::singleShot(100, this, SIGNAL(sigFoo()));
|
||||
QTimer::singleShot(800, this, SIGNAL(sigFoo()));
|
||||
QSignalSpy spy(this, &tst_QSignalSpy::sigFoo);
|
||||
QVERIFY(spy.wait());
|
||||
QCOMPARE(spy.size(), 1); // we don't wait for the second signal...
|
||||
QVERIFY(spy.wait());
|
||||
QCOMPARE(spy.size(), 2);
|
||||
QVERIFY(!spy.wait(1));
|
||||
QTimer::singleShot(10, this, SIGNAL(sigFoo()));
|
||||
QVERIFY(spy.wait());
|
||||
QCOMPARE(spy.size(), 3);
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyOnMetaMethod()
|
||||
{
|
||||
QObject obj;
|
||||
auto mo = obj.metaObject();
|
||||
|
||||
auto signalIndex = mo->indexOfSignal("objectNameChanged(QString)");
|
||||
QVERIFY(signalIndex != -1);
|
||||
|
||||
auto signal = mo->method(signalIndex);
|
||||
QVERIFY(signal.isValid());
|
||||
QCOMPARE(signal.methodType(), QMetaMethod::Signal);
|
||||
|
||||
QSignalSpy spy(&obj, signal);
|
||||
QVERIFY(spy.isValid());
|
||||
|
||||
obj.setObjectName("A new object name");
|
||||
QCOMPARE(spy.size(), 1);
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(QMetaMethod);
|
||||
void tst_QSignalSpy::spyOnMetaMethod_invalid()
|
||||
{
|
||||
QFETCH(QObject*, object);
|
||||
QFETCH(QMetaMethod, signal);
|
||||
|
||||
QSignalSpy spy(object, signal);
|
||||
QVERIFY(!spy.isValid());
|
||||
}
|
||||
|
||||
void tst_QSignalSpy::spyOnMetaMethod_invalid_data()
|
||||
{
|
||||
QTest::addColumn<QObject*>("object");
|
||||
QTest::addColumn<QMetaMethod>("signal");
|
||||
|
||||
QTest::addRow("Invalid object")
|
||||
<< static_cast<QObject*>(nullptr)
|
||||
<< QMetaMethod();
|
||||
|
||||
QTest::addRow("Empty signal")
|
||||
<< new QObject(this)
|
||||
<< QMetaMethod();
|
||||
|
||||
QTest::addRow("Method is not a signal")
|
||||
<< new QObject(this)
|
||||
<< QObject::staticMetaObject.method(QObject::staticMetaObject.indexOfMethod("deleteLater()"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QSignalSpy)
|
||||
#include "tst_qsignalspy.moc"
|
23
tests/auto/testlib/selftests/CATCH_LICENSE.txt
Normal file
23
tests/auto/testlib/selftests/CATCH_LICENSE.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
126
tests/auto/testlib/selftests/CMakeLists.txt
Normal file
126
tests/auto/testlib/selftests/CMakeLists.txt
Normal file
@ -0,0 +1,126 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# The whole file is written manually.
|
||||
|
||||
include(../../../../src/testlib/selfcover.cmake)
|
||||
|
||||
# ------------- Test runner -------------
|
||||
|
||||
# Resources:
|
||||
|
||||
file(GLOB qmake_expected_files_resource_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "expected_*")
|
||||
foreach(file IN LISTS qmake_expected_files_resource_files)
|
||||
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
|
||||
endforeach()
|
||||
|
||||
qt_internal_add_test(tst_selftests
|
||||
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
|
||||
EXCEPTIONS
|
||||
CATCH
|
||||
SOURCES
|
||||
tst_selftests.cpp
|
||||
catch.cpp
|
||||
LIBRARIES
|
||||
Qt::TestPrivate
|
||||
TESTDATA ${qmake_expected_files_resource_files}
|
||||
BUILTIN_TESTDATA
|
||||
# These lines need to be commented out as they need to be enabled
|
||||
# COMPILE_OPTIONS
|
||||
# conditionally
|
||||
# --cs-exclude-file-abs-wildcard=${QT_SOURCE_TREE}/*
|
||||
# --cs-include-file-abs-wildcard=*/src/testlib/*
|
||||
# --cs-mcc
|
||||
# --cs-mcdc
|
||||
# LINK_OPTIONS
|
||||
# "$$COVERAGE_OPTIONS"
|
||||
)
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(tst_selftests)
|
||||
|
||||
# ------------- Sub tests -------------
|
||||
|
||||
set(subprograms
|
||||
assert
|
||||
badxml
|
||||
benchlibcallgrind
|
||||
benchlibcounting
|
||||
benchlibeventcounter
|
||||
benchliboptions
|
||||
benchlibtickcounter
|
||||
benchlibwalltime
|
||||
blacklisted
|
||||
cmptest
|
||||
commandlinedata
|
||||
counting
|
||||
crashes
|
||||
datatable
|
||||
datetime
|
||||
deleteLater
|
||||
deleteLater_noApp
|
||||
differentexec
|
||||
eventloop
|
||||
exceptionthrow
|
||||
expectfail
|
||||
extendedcompare
|
||||
failcleanup
|
||||
failcleanuptestcase
|
||||
faildatatype
|
||||
failfetchtype
|
||||
failinit
|
||||
failinitdata
|
||||
fetchbogus
|
||||
findtestdata
|
||||
float
|
||||
globaldata
|
||||
junit
|
||||
longstring
|
||||
maxwarnings
|
||||
multiexec
|
||||
pass
|
||||
pairdiagnostics
|
||||
printdatatags
|
||||
printdatatagswithglobaltags
|
||||
qexecstringlist
|
||||
silent
|
||||
signaldumper
|
||||
singleskip
|
||||
skip
|
||||
skipcleanup
|
||||
skipcleanuptestcase
|
||||
skipinit
|
||||
skipinitdata
|
||||
sleep
|
||||
strcmp
|
||||
subtest
|
||||
testlib
|
||||
tuplediagnostics
|
||||
verbose1
|
||||
verbose2
|
||||
verifyexceptionthrown
|
||||
warnings
|
||||
watchdog
|
||||
)
|
||||
|
||||
if(TARGET Qt::Gui)
|
||||
list(APPEND subprograms
|
||||
keyboard
|
||||
mouse
|
||||
)
|
||||
endif()
|
||||
|
||||
# Ensure uniform location info between release and debug builds
|
||||
add_definitions(-DQT_MESSAGELOGCONTEXT)
|
||||
|
||||
foreach(subprogram IN LISTS subprograms)
|
||||
add_subdirectory(${subprogram})
|
||||
if(QT_FEATURE_process)
|
||||
add_dependencies(tst_selftests ${subprogram})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(JOIN subprograms " " subprograms)
|
||||
qt_internal_extend_target(tst_selftests
|
||||
DEFINES
|
||||
$<$<COMPILE_LANGUAGE:CXX>:SUBPROGRAMS=${subprograms}>
|
||||
)
|
71
tests/auto/testlib/selftests/README
Normal file
71
tests/auto/testlib/selftests/README
Normal file
@ -0,0 +1,71 @@
|
||||
|
||||
Running the QtTestLib selftests with Catch2
|
||||
===========================================
|
||||
|
||||
Catch2 [1] is a header only test framework that we use to allow
|
||||
testing QtTestLib without relying on any part of testlib itself.
|
||||
|
||||
To run the test suite, execute 'make check' or './tst_selftests'
|
||||
as normal. This should print:
|
||||
|
||||
===================================================================
|
||||
All tests passed (2453 assertions in 5 test cases)
|
||||
|
||||
To run specific tests, first lists the available tests:
|
||||
|
||||
❯ ./tst_selftests -l
|
||||
All available test cases:
|
||||
Loggers support both old and new style arguments
|
||||
Loggers can output to both file and stdout
|
||||
Logging to file and stdout at the same time
|
||||
All loggers can be enabled at the same time
|
||||
Scenario: Test output of the loggers is as expected
|
||||
5 test cases
|
||||
|
||||
Then pass the name of the test in quotes as the first argument:
|
||||
|
||||
❯ ./tst_selftests "Loggers support both old and new style arguments"
|
||||
Filters: Loggers support both old and new style arguments
|
||||
==================================================================
|
||||
All tests passed (96 assertions in 1 test case)
|
||||
|
||||
You can find the tests in the sources as individual TEST_CASE
|
||||
entries. Note that each of these tests run the tests once per
|
||||
logger, and in the case of the test log check also all sub tests,
|
||||
so the amount of actual test assertions is much higher than the
|
||||
five tests listed above.
|
||||
|
||||
To see what the tests is actually doing, pass the -s option.
|
||||
This will result in very verbose output. Each leaf test is
|
||||
prefixed with a heading:
|
||||
|
||||
---------------------------------------------------------------
|
||||
Given: The QTestLog::TAP logger
|
||||
When: Passing arguments with new style
|
||||
---------------------------------------------------------------
|
||||
|
||||
You can choose a specific subtest by passing the -c option:
|
||||
|
||||
❯ ./tst_selftests "Scenario: Test output of the loggers is as expected" \
|
||||
-c "Given: The QTestLog::Plain logger" \
|
||||
-c 'And given: The "skip" subtest'
|
||||
|
||||
It's possible to pass only the first -c options, to e.g. run all
|
||||
tests with the Plain logger, but it's unfortunately not possible
|
||||
to pass only the last -c option, to run the 'skip' subtest with
|
||||
all loggers.
|
||||
|
||||
If a test fails it will print the expected, actual, and difference.
|
||||
The test results are also left in a temporary directory for closer
|
||||
inspection.
|
||||
|
||||
Add new tests by modifying selftest.pri and CMakeLists.txt, adding
|
||||
a new subprogram.
|
||||
|
||||
Generating new test expectations is done using the python script
|
||||
in this directory (generate_expected_output.py). In the future this
|
||||
will be done with the --rebase option to ./tst_selftest, but this
|
||||
is not fleshed out yet.
|
||||
|
||||
[1] https://github.com/catchorg/Catch2
|
||||
|
20
tests/auto/testlib/selftests/assert/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/assert/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## assert Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(assert
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_assert.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(assert)
|
37
tests/auto/testlib/selftests/assert/tst_assert.cpp
Normal file
37
tests/auto/testlib/selftests/assert/tst_assert.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
// Make sure we get a real Q_ASSERT even in release builds
|
||||
#ifdef QT_NO_DEBUG
|
||||
# undef QT_NO_DEBUG
|
||||
#endif
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_Assert: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testNumber1() const;
|
||||
void testNumber2() const;
|
||||
void testNumber3() const;
|
||||
};
|
||||
|
||||
void tst_Assert::testNumber1() const
|
||||
{
|
||||
}
|
||||
|
||||
void tst_Assert::testNumber2() const
|
||||
{
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
||||
void tst_Assert::testNumber3() const
|
||||
{
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_Assert)
|
||||
|
||||
#include "tst_assert.moc"
|
21
tests/auto/testlib/selftests/badxml/CMakeLists.txt
Normal file
21
tests/auto/testlib/selftests/badxml/CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## badxml Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(badxml
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_badxml.cpp
|
||||
LIBRARIES
|
||||
Qt::CorePrivate
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(badxml)
|
195
tests/auto/testlib/selftests/badxml/tst_badxml.cpp
Normal file
195
tests/auto/testlib/selftests/badxml/tst_badxml.cpp
Normal file
@ -0,0 +1,195 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QTest>
|
||||
#include <private/qmetaobjectbuilder_p.h>
|
||||
|
||||
/*
|
||||
This test makes a testlog containing lots of characters which have a special meaning in
|
||||
XML, with the purpose of exposing bugs in testlib's XML output code.
|
||||
*/
|
||||
class tst_BadXml : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void badDataTag() const;
|
||||
void badDataTag_data() const;
|
||||
|
||||
void badMessage() const;
|
||||
void badMessage_data() const;
|
||||
|
||||
void failWithNoFile() const;
|
||||
|
||||
void encoding();
|
||||
|
||||
public:
|
||||
static QList<QByteArray> const& badStrings();
|
||||
};
|
||||
|
||||
/*
|
||||
Custom metaobject to make it possible to change class name at runtime.
|
||||
*/
|
||||
class EmptyClass : public tst_BadXml
|
||||
{ Q_OBJECT };
|
||||
|
||||
class tst_BadXmlSub : public tst_BadXml
|
||||
{
|
||||
public:
|
||||
tst_BadXmlSub()
|
||||
: className("tst_BadXml"), mo(0) {}
|
||||
~tst_BadXmlSub() { free(mo); }
|
||||
|
||||
const QMetaObject* metaObject() const override;
|
||||
|
||||
QByteArray className;
|
||||
private:
|
||||
QMetaObject *mo;
|
||||
};
|
||||
|
||||
const QMetaObject* tst_BadXmlSub::metaObject() const
|
||||
{
|
||||
if (!mo || (mo->className() != className)) {
|
||||
free(mo);
|
||||
QMetaObjectBuilder builder(&EmptyClass::staticMetaObject);
|
||||
builder.setClassName(className);
|
||||
const_cast<tst_BadXmlSub *>(this)->mo = builder.toMetaObject();
|
||||
}
|
||||
return mo;
|
||||
}
|
||||
|
||||
/*
|
||||
Outputs incidents and benchmark results with the current data tag set to a bad string.
|
||||
*/
|
||||
void tst_BadXml::badDataTag() const
|
||||
{
|
||||
qDebug("a message");
|
||||
|
||||
QBENCHMARK {
|
||||
}
|
||||
|
||||
QFETCH(bool, shouldFail);
|
||||
if (shouldFail)
|
||||
QFAIL("a failure");
|
||||
}
|
||||
|
||||
void tst_BadXml::badDataTag_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("shouldFail");
|
||||
|
||||
foreach (char const* str, badStrings()) {
|
||||
QTest::newRow(qPrintable(QString("fail %1").arg(str))) << true;
|
||||
QTest::newRow(qPrintable(QString("pass %1").arg(str))) << false;
|
||||
}
|
||||
}
|
||||
|
||||
void tst_BadXml::failWithNoFile() const
|
||||
{
|
||||
QTest::qFail("failure message", 0, 0);
|
||||
}
|
||||
|
||||
// QTBUG-35743, test whether XML is using correct UTF-8 encoding
|
||||
// on platforms where the console encoding differs.
|
||||
void tst_BadXml::encoding()
|
||||
{
|
||||
QStringList arguments = QCoreApplication::arguments();
|
||||
arguments.pop_front(); // Prevent match on binary "badxml"
|
||||
if (arguments.filter(QStringLiteral("xml")).isEmpty())
|
||||
QSKIP("Skipped for text due to unpredictable console encoding.");
|
||||
QString string;
|
||||
string += QChar(ushort(0xDC)); // German umlaut Ue
|
||||
string += QStringLiteral("lrich ");
|
||||
string += QChar(ushort(0xDC)); // German umlaut Ue
|
||||
string += QStringLiteral("ml");
|
||||
string += QChar(ushort(0xE4)); // German umlaut ae
|
||||
string += QStringLiteral("ut");
|
||||
qDebug() << string;
|
||||
}
|
||||
|
||||
/*
|
||||
Outputs a message containing a bad string.
|
||||
*/
|
||||
void tst_BadXml::badMessage() const
|
||||
{
|
||||
QFETCH(QByteArray, message);
|
||||
qDebug("%s", message.constData());
|
||||
}
|
||||
|
||||
void tst_BadXml::badMessage_data() const
|
||||
{
|
||||
QTest::addColumn<QByteArray>("message");
|
||||
|
||||
int i = 0;
|
||||
foreach (QByteArray const& str, badStrings()) {
|
||||
QTest::newRow(qPrintable(QString::fromLatin1("string %1").arg(i++))) << str;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Returns a list of strings likely to expose bugs in XML output code.
|
||||
*/
|
||||
QList<QByteArray> const& tst_BadXml::badStrings()
|
||||
{
|
||||
static QList<QByteArray> out;
|
||||
if (out.isEmpty()) {
|
||||
out << "end cdata ]]> text ]]> more text";
|
||||
out << "quotes \" text\" more text";
|
||||
out << "xml close > open < tags < text";
|
||||
out << "all > \" mixed ]]> up > \" in < the ]]> hopes < of triggering \"< ]]> bugs";
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
/*
|
||||
tst_selftests can't handle multiple XML documents in a single testrun, so we'll
|
||||
decide before we begin which of our "bad strings" we want to use for our testcase
|
||||
name.
|
||||
*/
|
||||
int badstring = -1;
|
||||
QList<char const *> args;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (!strcmp(argv[i], "-badstring")) {
|
||||
bool ok = false;
|
||||
if (i < argc-1) {
|
||||
badstring = QByteArray(argv[i+1]).toInt(&ok);
|
||||
++i;
|
||||
}
|
||||
if (!ok) {
|
||||
qFatal("Bad `-badstring' option");
|
||||
}
|
||||
}
|
||||
else {
|
||||
args << argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
args << "-eventcounter";
|
||||
|
||||
/*
|
||||
We just want testlib to output a benchmark result, we don't actually care about the value,
|
||||
so just do one iteration to save time.
|
||||
*/
|
||||
args << "-iterations" << "1";
|
||||
|
||||
if (badstring == -1) {
|
||||
tst_BadXml test;
|
||||
return QTest::qExec(&test, args.size(), const_cast<char**>(args.data()));
|
||||
}
|
||||
|
||||
QList<QByteArray> badstrings = tst_BadXml::badStrings();
|
||||
if (badstring >= badstrings.size())
|
||||
qFatal("`-badstring %d' is out of range", badstring);
|
||||
|
||||
tst_BadXmlSub test;
|
||||
test.className = badstrings[badstring].constData();
|
||||
return QTest::qExec(&test, args.size(), const_cast<char**>(args.data()));
|
||||
}
|
||||
|
||||
#include "tst_badxml.moc"
|
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## benchlibcallgrind Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(benchlibcallgrind
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_benchlibcallgrind.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(benchlibcallgrind)
|
@ -0,0 +1,72 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
#if __has_include(<valgrind/valgrind.h>)
|
||||
# include <valgrind/valgrind.h>
|
||||
# define HAVE_VALGRIND_H
|
||||
#endif
|
||||
|
||||
class tst_BenchlibCallgrind: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void failInChildProcess();
|
||||
|
||||
void twoHundredMillionInstructions();
|
||||
};
|
||||
|
||||
void tst_BenchlibCallgrind::failInChildProcess()
|
||||
{
|
||||
#ifdef HAVE_VALGRIND_H
|
||||
static double f = 1.0;
|
||||
QBENCHMARK {
|
||||
for (int i = 0; i < 1000000; ++i) {
|
||||
f *= 1.1;
|
||||
if (RUNNING_ON_VALGRIND) QFAIL("Running under valgrind!");
|
||||
}
|
||||
}
|
||||
#else
|
||||
QSKIP("Skipping test because I can't see <valgrind/valgrind.h> - is valgrind installed ?");
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_BenchlibCallgrind::twoHundredMillionInstructions()
|
||||
{
|
||||
#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
|
||||
QBENCHMARK {
|
||||
__asm__ __volatile__(
|
||||
"mov $100000000,%%eax \n"
|
||||
"1: \n"
|
||||
"dec %%eax \n"
|
||||
"jnz 1b \n"
|
||||
: /* no output */
|
||||
: /* no input */
|
||||
: /* clobber */ "eax"
|
||||
);
|
||||
}
|
||||
#else
|
||||
QSKIP("This test is only implemented for gcc on x86.");
|
||||
#endif
|
||||
}
|
||||
|
||||
QTEST_MAIN_WRAPPER(tst_BenchlibCallgrind,
|
||||
std::vector<const char*> args(argv, argv + argc);
|
||||
// Add the -callgrind argument unless (it's there anyway or) we're the
|
||||
// recursive invocation with -callgrindchild passed.
|
||||
if (std::find_if(args.begin(), args.end(),
|
||||
[](const char *arg) {
|
||||
return qstrcmp(arg, "-callgrindchild") == 0
|
||||
|| qstrcmp(arg, "-callgrind") == 0;
|
||||
}) == args.end()) {
|
||||
args.push_back("-callgrind");
|
||||
argc = args.size();
|
||||
argv = const_cast<char**>(&args[0]);
|
||||
}
|
||||
QTEST_MAIN_SETUP())
|
||||
|
||||
#undef HAVE_VALGRIND_H
|
||||
#include "tst_benchlibcallgrind.moc"
|
20
tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## benchlibcounting Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(benchlibcounting
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_benchlibcounting.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(tst_selftests)
|
@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_BenchlibCounting : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void passingBenchmark();
|
||||
void skippingBenchmark();
|
||||
void failingBenchmark();
|
||||
};
|
||||
|
||||
void tst_BenchlibCounting::passingBenchmark()
|
||||
{
|
||||
QBENCHMARK {
|
||||
}
|
||||
}
|
||||
|
||||
void tst_BenchlibCounting::skippingBenchmark()
|
||||
{
|
||||
QBENCHMARK {
|
||||
QSKIP("This is a skipping benchmark");
|
||||
}
|
||||
}
|
||||
|
||||
void tst_BenchlibCounting::failingBenchmark()
|
||||
{
|
||||
QBENCHMARK {
|
||||
QFAIL("This is a failing benchmark");
|
||||
};
|
||||
}
|
||||
|
||||
QTEST_MAIN_WRAPPER(tst_BenchlibCounting,
|
||||
std::vector<const char*> args(argv, argv + argc);
|
||||
args.push_back("-eventcounter");
|
||||
argc = args.size();
|
||||
argv = const_cast<char**>(&args[0]);
|
||||
QTEST_MAIN_SETUP())
|
||||
|
||||
#include "tst_benchlibcounting.moc"
|
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## benchlibeventcounter Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(benchlibeventcounter
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_benchlibeventcounter.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(benchlibeventcounter)
|
@ -0,0 +1,85 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
#if defined(Q_OS_WIN32)
|
||||
#include <QWinEventNotifier>
|
||||
#endif
|
||||
#include <QAbstractEventDispatcher>
|
||||
|
||||
/* Custom event dispatcher to ensure we don't receive any spontaneous events */
|
||||
class TestEventDispatcher : public QAbstractEventDispatcher
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TestEventDispatcher(QObject* parent =0)
|
||||
: QAbstractEventDispatcher(parent)
|
||||
{}
|
||||
void interrupt() override {}
|
||||
bool processEvents(QEventLoop::ProcessEventsFlags) override { return false; }
|
||||
void registerSocketNotifier(QSocketNotifier*) override {}
|
||||
void registerTimer(int,qint64,Qt::TimerType,QObject*) override {}
|
||||
QList<TimerInfo> registeredTimers(QObject*) const override { return QList<TimerInfo>(); }
|
||||
void unregisterSocketNotifier(QSocketNotifier*) override {}
|
||||
bool unregisterTimer(int) override { return false; }
|
||||
bool unregisterTimers(QObject*) override { return false; }
|
||||
int remainingTime(int) override { return 0; }
|
||||
void wakeUp() override {}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
bool registerEventNotifier(QWinEventNotifier *) { return false; }
|
||||
void unregisterEventNotifier(QWinEventNotifier *) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
class tst_BenchlibEventCounter: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void events();
|
||||
void events_data();
|
||||
};
|
||||
|
||||
void tst_BenchlibEventCounter::events()
|
||||
{
|
||||
QFETCH(int, eventCount);
|
||||
|
||||
QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance();
|
||||
QBENCHMARK {
|
||||
for (int i = 0; i < eventCount; ++i) {
|
||||
ed->filterNativeEvent("", 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tst_BenchlibEventCounter::events_data()
|
||||
{
|
||||
QTest::addColumn<int>("eventCount");
|
||||
|
||||
QTest::newRow("0") << 0;
|
||||
QTest::newRow("1") << 1;
|
||||
QTest::newRow("10") << 10;
|
||||
QTest::newRow("100") << 100;
|
||||
QTest::newRow("500") << 500;
|
||||
QTest::newRow("5000") << 5000;
|
||||
QTest::newRow("100000") << 100000;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::vector<const char*> args(argv, argv + argc);
|
||||
args.push_back("-eventcounter");
|
||||
argc = args.size();
|
||||
argv = const_cast<char**>(&args[0]);
|
||||
|
||||
TestEventDispatcher dispatcher;
|
||||
QCoreApplication app(argc, argv);
|
||||
tst_BenchlibEventCounter test;
|
||||
return QTest::qExec(&test, argc, argv);
|
||||
}
|
||||
|
||||
#include "tst_benchlibeventcounter.moc"
|
20
tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## benchliboptions Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(benchliboptions
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_benchliboptions.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(tst_selftests)
|
@ -0,0 +1,100 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
#if defined(Q_OS_WIN32)
|
||||
#include <QWinEventNotifier>
|
||||
#endif
|
||||
#include <QAbstractEventDispatcher>
|
||||
|
||||
/* Custom event dispatcher to ensure we don't receive any spontaneous events */
|
||||
class TestEventDispatcher : public QAbstractEventDispatcher
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TestEventDispatcher(QObject* parent =0)
|
||||
: QAbstractEventDispatcher(parent)
|
||||
{}
|
||||
void interrupt() override {}
|
||||
bool processEvents(QEventLoop::ProcessEventsFlags) override { return false; }
|
||||
void registerSocketNotifier(QSocketNotifier*) override {}
|
||||
void registerTimer(int,qint64,Qt::TimerType,QObject*) override {}
|
||||
QList<TimerInfo> registeredTimers(QObject*) const override { return QList<TimerInfo>(); }
|
||||
void unregisterSocketNotifier(QSocketNotifier*) override {}
|
||||
bool unregisterTimer(int) override { return false; }
|
||||
bool unregisterTimers(QObject*) override { return false; }
|
||||
int remainingTime(int) override { return 0; }
|
||||
void wakeUp() override {}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
bool registerEventNotifier(QWinEventNotifier *) { return false; }
|
||||
void unregisterEventNotifier(QWinEventNotifier *) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
class tst_BenchlibOptions: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void threeEvents();
|
||||
};
|
||||
|
||||
class tst_BenchlibFifteenIterations : public tst_BenchlibOptions
|
||||
{ Q_OBJECT };
|
||||
class tst_BenchlibOneHundredMinimum : public tst_BenchlibOptions
|
||||
{ Q_OBJECT };
|
||||
|
||||
void tst_BenchlibOptions::threeEvents()
|
||||
{
|
||||
QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance();
|
||||
QBENCHMARK {
|
||||
ed->filterNativeEvent("", 0, 0);
|
||||
ed->filterNativeEvent("", 0, 0);
|
||||
ed->filterNativeEvent("", 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::vector<const char*> args(argv, argv + argc);
|
||||
args.push_back("-eventcounter");
|
||||
|
||||
int ret = 0;
|
||||
|
||||
TestEventDispatcher dispatcher;
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
/* Run with no special arguments. */
|
||||
{
|
||||
tst_BenchlibOptions test;
|
||||
ret += QTest::qExec(&test, int(args.size()), const_cast<char**>(&args[0]));
|
||||
}
|
||||
|
||||
/* Run with an exact number of iterations. */
|
||||
{
|
||||
auto extraArgs = args;
|
||||
extraArgs.push_back("-iterations");
|
||||
extraArgs.push_back("15");
|
||||
tst_BenchlibFifteenIterations test;
|
||||
ret += QTest::qExec(&test, int(extraArgs.size()), const_cast<char**>(&extraArgs[0]));
|
||||
}
|
||||
|
||||
/*
|
||||
Run until getting a value of at least 100.
|
||||
*/
|
||||
{
|
||||
auto extraArgs = args;
|
||||
extraArgs.push_back("-minimumvalue");
|
||||
extraArgs.push_back("100");
|
||||
tst_BenchlibOneHundredMinimum test;
|
||||
ret += QTest::qExec(&test, int(extraArgs.size()), const_cast<char**>(&extraArgs[0]));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#include "tst_benchliboptions.moc"
|
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## benchlibtickcounter Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(benchlibtickcounter
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_benchlibtickcounter.cpp
|
||||
LIBRARIES
|
||||
Qt::TestPrivate
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(benchlibtickcounter)
|
@ -0,0 +1,47 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
#include <private/cycle_p.h>
|
||||
|
||||
class tst_BenchlibTickCounter: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void threeBillionTicks();
|
||||
};
|
||||
|
||||
void tst_BenchlibTickCounter::threeBillionTicks()
|
||||
{
|
||||
#ifndef HAVE_TICK_COUNTER
|
||||
QSKIP("Tick counter not available on this platform");
|
||||
#else
|
||||
QBENCHMARK {
|
||||
CycleCounterTicks start = getticks();
|
||||
double el = 0.;
|
||||
double max = el;
|
||||
while (el < 3000000000.) {
|
||||
/* Verify that elapsed time never decreases */
|
||||
QVERIFY2(el >= max, qPrintable(
|
||||
QString("Tick counter is not monotonic\nElapsed moved from %1 to %2")
|
||||
.arg(max).arg(el)
|
||||
));
|
||||
max = el;
|
||||
el = elapsed(getticks(), start);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QTEST_MAIN_WRAPPER(tst_BenchlibTickCounter,
|
||||
std::vector<const char*> args(argv, argv + argc);
|
||||
args.push_back("-tickcounter");
|
||||
argc = args.size();
|
||||
argv = const_cast<char**>(&args[0]);
|
||||
QTEST_MAIN_SETUP())
|
||||
|
||||
#include "tst_benchlibtickcounter.moc"
|
20
tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## benchlibwalltime Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(benchlibwalltime
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_benchlibwalltime.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(benchlibwalltime)
|
@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_BenchlibWalltime: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void waitForOneThousand();
|
||||
void waitForFourThousand();
|
||||
void qbenchmark_once();
|
||||
};
|
||||
|
||||
void tst_BenchlibWalltime::waitForOneThousand()
|
||||
{
|
||||
QBENCHMARK {
|
||||
QTest::qWait(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_BenchlibWalltime::waitForFourThousand()
|
||||
{
|
||||
QBENCHMARK {
|
||||
QTest::qWait(4000);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_BenchlibWalltime::qbenchmark_once()
|
||||
{
|
||||
int iterations = 0;
|
||||
QBENCHMARK_ONCE {
|
||||
++iterations;
|
||||
}
|
||||
QCOMPARE(iterations, 1);
|
||||
}
|
||||
|
||||
|
||||
QTEST_MAIN(tst_BenchlibWalltime)
|
||||
|
||||
#include "tst_benchlibwalltime.moc"
|
34
tests/auto/testlib/selftests/blacklisted/BLACKLIST
Normal file
34
tests/auto/testlib/selftests/blacklisted/BLACKLIST
Normal file
@ -0,0 +1,34 @@
|
||||
obscure # no such platform; is ignored
|
||||
|
||||
[pass]
|
||||
*
|
||||
|
||||
[skip]
|
||||
*
|
||||
|
||||
[fail]
|
||||
*
|
||||
|
||||
[multiSkip]
|
||||
*
|
||||
|
||||
[multiFail]
|
||||
*
|
||||
|
||||
[xfail]
|
||||
*
|
||||
|
||||
[xfailContinueSkip]
|
||||
*
|
||||
|
||||
[xfailContinueFail]
|
||||
*
|
||||
|
||||
[xpass]
|
||||
*
|
||||
|
||||
[xpassContinueSkip]
|
||||
*
|
||||
|
||||
[xpassContinueFail]
|
||||
*
|
20
tests/auto/testlib/selftests/blacklisted/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/blacklisted/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## blacklisted Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(blacklisted
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_blacklisted.cpp
|
||||
LIBRARIES
|
||||
Qt::TestPrivate
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(blacklisted)
|
130
tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
Normal file
130
tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
Normal file
@ -0,0 +1,130 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
#include <private/qtestlog_p.h>
|
||||
|
||||
class tst_Blacklisted : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void init();
|
||||
void cleanupTestCase();
|
||||
void pass();
|
||||
void skip();
|
||||
void fail();
|
||||
void xfail();
|
||||
void multiSkip();
|
||||
void multiFail();
|
||||
void xfailContinueSkip();
|
||||
void xfailContinueFail();
|
||||
void xpass();
|
||||
void xpassContinueSkip();
|
||||
void xpassContinueFail();
|
||||
|
||||
private:
|
||||
int casesTested = 2;
|
||||
// What the totals line's numbers *should* be:
|
||||
int passed = 2, skipped = 0, blacklisted = 0;
|
||||
// Total and passed get {init,cleanup}TestCase() in addition to the actual tests.
|
||||
};
|
||||
|
||||
void tst_Blacklisted::init()
|
||||
{
|
||||
++casesTested;
|
||||
}
|
||||
|
||||
void tst_Blacklisted::cleanupTestCase()
|
||||
{
|
||||
qDebug("Totals should add up to %d: %d passed, 0 failed, %d skipped, %d blacklisted",
|
||||
casesTested, passed, skipped, blacklisted);
|
||||
}
|
||||
|
||||
// All the tests below have been blacklisted in blacklisted/BLACKLIST
|
||||
|
||||
void tst_Blacklisted::pass()
|
||||
{
|
||||
++blacklisted;
|
||||
qDebug("This test should BPASS");
|
||||
QVERIFY(true);
|
||||
}
|
||||
|
||||
void tst_Blacklisted::skip()
|
||||
{
|
||||
++skipped;
|
||||
QSKIP("This test should SKIP");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::fail()
|
||||
{
|
||||
++blacklisted;
|
||||
QVERIFY2(false, "This test should BFAIL");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::multiFail() // cf. ../subtest/'s similar tests
|
||||
{
|
||||
++blacklisted;
|
||||
for (int i = 0; i < 10; ++i)
|
||||
[]() { QFAIL("This failure message should be repeated ten times"); }();
|
||||
QFAIL("But this test should only contribute one to the blacklisted count");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::multiSkip()
|
||||
{
|
||||
// Similar to multiFail()
|
||||
++skipped;
|
||||
for (int i = 0; i < 10; ++i)
|
||||
[]() { QSKIP("This skip should be repeated ten times"); }();
|
||||
QSKIP("But this test should only contribute one to the skip count");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::xfail()
|
||||
{
|
||||
++blacklisted;
|
||||
QEXPECT_FAIL("", "This test should BXFAIL then BPASS", Abort);
|
||||
QVERIFY(false);
|
||||
}
|
||||
|
||||
void tst_Blacklisted::xfailContinueSkip()
|
||||
{
|
||||
++skipped;
|
||||
QEXPECT_FAIL("", "This test should BXFAIL then SKIP", Continue);
|
||||
QVERIFY(false);
|
||||
QSKIP("This skip should be seen and counted");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::xfailContinueFail()
|
||||
{
|
||||
++blacklisted;
|
||||
QEXPECT_FAIL("", "This test should BXFAIL then BFAIL", Continue);
|
||||
QVERIFY(false);
|
||||
QFAIL("This fail should be seen and counted as blacklisted");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::xpass()
|
||||
{
|
||||
++blacklisted;
|
||||
QEXPECT_FAIL("", "This test should BXPASS", Abort);
|
||||
QVERIFY2(true, "This test should BXPASS");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::xpassContinueSkip()
|
||||
{
|
||||
++blacklisted;
|
||||
QEXPECT_FAIL("", "This test should BXPASS then SKIP", Continue);
|
||||
QVERIFY2(true, "This test should BXPASS then SKIP");
|
||||
QSKIP("This skip should be seen but not counted");
|
||||
}
|
||||
|
||||
void tst_Blacklisted::xpassContinueFail()
|
||||
{
|
||||
++blacklisted;
|
||||
QEXPECT_FAIL("", "This test should BXPASS then BFAIL", Continue);
|
||||
QVERIFY2(true, "This test should BXPASS then BFAIL");
|
||||
QFAIL("This fail should be seen and not counted (due to prior XPASS)");
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_Blacklisted)
|
||||
#include "tst_blacklisted.moc"
|
30
tests/auto/testlib/selftests/catch.cpp
Normal file
30
tests/auto/testlib/selftests/catch.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2020 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#define CATCH_CLARA_CONFIG_CONSOLE_WIDTH 1000
|
||||
|
||||
#if defined(QT_NO_EXCEPTIONS)
|
||||
#define CATCH_CONFIG_DISABLE_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#include "catch_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QTestPrivate {
|
||||
|
||||
int catchMain(int argc, char **argv)
|
||||
{
|
||||
Catch::Session session;
|
||||
|
||||
if (int returnCode = session.applyCommandLine(argc, argv))
|
||||
return returnCode; // Command line error
|
||||
|
||||
return session.run();
|
||||
}
|
||||
|
||||
} // namespace QTestPrivate
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
30
tests/auto/testlib/selftests/catch_p.h
Normal file
30
tests/auto/testlib/selftests/catch_p.h
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2020 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#ifndef QCATCH_P_H
|
||||
#define QCATCH_P_H
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#include "catch_p_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QTestPrivate {
|
||||
int catchMain(int argc, char* argv[]);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QCATCH_P_H
|
17978
tests/auto/testlib/selftests/catch_p_p.h
Normal file
17978
tests/auto/testlib/selftests/catch_p_p.h
Normal file
File diff suppressed because it is too large
Load Diff
25
tests/auto/testlib/selftests/cmptest/CMakeLists.txt
Normal file
25
tests/auto/testlib/selftests/cmptest/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## cmptest Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(cmptest
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_cmptest.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_extend_target(cmptest CONDITION TARGET Qt::Gui
|
||||
LIBRARIES
|
||||
Qt::Gui
|
||||
)
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(cmptest)
|
758
tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
Normal file
758
tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
Normal file
@ -0,0 +1,758 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#ifdef QT_GUI_LIB
|
||||
#include <QtGui/QColor>
|
||||
#include <QtGui/QImage>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QVector2D>
|
||||
#include <QtGui/QVector3D>
|
||||
#include <QtGui/QVector4D>
|
||||
#endif
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
/* XPM test data for QPixmap, QImage tests (use drag cursors as example) */
|
||||
|
||||
static const char * const xpmPixmapData1[] = {
|
||||
"11 20 3 1",
|
||||
". c None",
|
||||
"a c #FFFFFF",
|
||||
"X c #000000", // X11 cursor is traditionally black
|
||||
"aa.........",
|
||||
"aXa........",
|
||||
"aXXa.......",
|
||||
"aXXXa......",
|
||||
"aXXXXa.....",
|
||||
"aXXXXXa....",
|
||||
"aXXXXXXa...",
|
||||
"aXXXXXXXa..",
|
||||
"aXXXXXXXXa.",
|
||||
"aXXXXXXXXXa",
|
||||
"aXXXXXXaaaa",
|
||||
"aXXXaXXa...",
|
||||
"aXXaaXXa...",
|
||||
"aXa..aXXa..",
|
||||
"aa...aXXa..",
|
||||
"a.....aXXa.",
|
||||
"......aXXa.",
|
||||
".......aXXa",
|
||||
".......aXXa",
|
||||
"........aa."};
|
||||
|
||||
static const char * const xpmPixmapData2[] = {
|
||||
"11 20 4 1",
|
||||
". c None",
|
||||
"a c #FFFFFF",
|
||||
"b c #0000FF",
|
||||
"X c #000000",
|
||||
"aab........",
|
||||
"aXab.......",
|
||||
"aXXab......",
|
||||
"aXXXab.....",
|
||||
"aXXXXab....",
|
||||
"aXXXXXab...",
|
||||
"aXXXXXXab..",
|
||||
"aXXXXXXXa..",
|
||||
"aXXXXXXXXa.",
|
||||
"aXXXXXXXXXa",
|
||||
"aXXXXXXaaaa",
|
||||
"aXXXaXXa...",
|
||||
"aXXaaXXa...",
|
||||
"aXa..aXXa..",
|
||||
"aa...aXXa..",
|
||||
"a.....aXXa.",
|
||||
"......aXXa.",
|
||||
".......aXXa",
|
||||
".......aXXa",
|
||||
"........aa."};
|
||||
|
||||
static const char * const xpmPixmapData3[] = {
|
||||
"20 20 2 1",
|
||||
" c #000000",
|
||||
". c #C32D2D",
|
||||
" ..........",
|
||||
" ........",
|
||||
" .......",
|
||||
" ......",
|
||||
" ....",
|
||||
" ..",
|
||||
" .",
|
||||
" ",
|
||||
" ",
|
||||
". ",
|
||||
"... ",
|
||||
"..... ",
|
||||
"...... ",
|
||||
"....... ",
|
||||
"......... ",
|
||||
"........... ",
|
||||
"........... ",
|
||||
"............ ",
|
||||
"............ ",
|
||||
"............. "};
|
||||
|
||||
class tst_Cmptest: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum class MyClassEnum { MyClassEnumValue1, MyClassEnumValue2 };
|
||||
Q_ENUM(MyClassEnum)
|
||||
|
||||
private slots:
|
||||
void compare_unregistered_enums();
|
||||
void compare_registered_enums();
|
||||
void compare_class_enums();
|
||||
void test_windowflags_data();
|
||||
void test_windowflags();
|
||||
void test_unregistered_flags_data();
|
||||
void test_unregistered_flags();
|
||||
void compare_boolfuncs();
|
||||
void compare_to_nullptr();
|
||||
void compare_pointerfuncs();
|
||||
void compare_tostring();
|
||||
void compare_tostring_data();
|
||||
void compare_unknown();
|
||||
void compare_textFromDebug();
|
||||
void compareQObjects();
|
||||
void compareQStringLists();
|
||||
void compareQStringLists_data();
|
||||
void compareQListInt_data();
|
||||
void compareQListInt();
|
||||
void compareQListIntToArray_data();
|
||||
void compareQListIntToArray();
|
||||
void compareQListIntToInitializerList_data();
|
||||
void compareQListIntToInitializerList();
|
||||
void compareQListDouble();
|
||||
#ifdef QT_GUI_LIB
|
||||
void compareQColor_data();
|
||||
void compareQColor();
|
||||
void compareQPixmaps();
|
||||
void compareQPixmaps_data();
|
||||
void compareQImages();
|
||||
void compareQImages_data();
|
||||
void compareQRegion_data();
|
||||
void compareQRegion();
|
||||
void compareQVector2D();
|
||||
void compareQVector3D();
|
||||
void compareQVector4D();
|
||||
#endif
|
||||
void tryCompare();
|
||||
void verify();
|
||||
void verify2();
|
||||
void tryVerify();
|
||||
void tryVerify2();
|
||||
void verifyExplicitOperatorBool();
|
||||
};
|
||||
|
||||
enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 };
|
||||
|
||||
void tst_Cmptest::compare_unregistered_enums()
|
||||
{
|
||||
QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue1);
|
||||
QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue2);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compare_registered_enums()
|
||||
{
|
||||
// use an enum that doesn't start at 0
|
||||
QCOMPARE(Qt::Monday, Qt::Monday);
|
||||
QCOMPARE(Qt::Monday, Qt::Sunday);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compare_class_enums()
|
||||
{
|
||||
QCOMPARE(MyClassEnum::MyClassEnumValue1, MyClassEnum::MyClassEnumValue1);
|
||||
QCOMPARE(MyClassEnum::MyClassEnumValue1, MyClassEnum::MyClassEnumValue2);
|
||||
}
|
||||
|
||||
void tst_Cmptest::test_windowflags_data()
|
||||
{
|
||||
QTest::addColumn<Qt::WindowFlags>("actualWindowFlags");
|
||||
QTest::addColumn<Qt::WindowFlags>("expectedWindowFlags");
|
||||
|
||||
const Qt::WindowFlags windowFlags = Qt::Window
|
||||
| Qt::WindowSystemMenuHint | Qt::WindowStaysOnBottomHint;
|
||||
QTest::newRow("pass")
|
||||
<< windowFlags
|
||||
<< windowFlags;
|
||||
QTest::newRow("fail1")
|
||||
<< windowFlags
|
||||
<< (windowFlags | Qt::FramelessWindowHint);
|
||||
QTest::newRow("fail2")
|
||||
<< Qt::WindowFlags(Qt::Window)
|
||||
<< Qt::WindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||
}
|
||||
|
||||
void tst_Cmptest::test_windowflags()
|
||||
{
|
||||
QFETCH(Qt::WindowFlags, actualWindowFlags);
|
||||
QFETCH(Qt::WindowFlags, expectedWindowFlags);
|
||||
QCOMPARE(actualWindowFlags, expectedWindowFlags);
|
||||
}
|
||||
|
||||
enum UnregisteredEnum {
|
||||
UnregisteredEnumValue1 = 0x1,
|
||||
UnregisteredEnumValue2 = 0x2,
|
||||
UnregisteredEnumValue3 = 0x4
|
||||
};
|
||||
|
||||
typedef QFlags<UnregisteredEnum> UnregisteredFlags;
|
||||
|
||||
Q_DECLARE_METATYPE(UnregisteredFlags);
|
||||
|
||||
void tst_Cmptest::test_unregistered_flags_data()
|
||||
{
|
||||
QTest::addColumn<UnregisteredFlags>("actualFlags");
|
||||
QTest::addColumn<UnregisteredFlags>("expectedFlags");
|
||||
|
||||
QTest::newRow("pass")
|
||||
<< UnregisteredFlags(UnregisteredEnumValue1)
|
||||
<< UnregisteredFlags(UnregisteredEnumValue1);
|
||||
QTest::newRow("fail1")
|
||||
<< UnregisteredFlags(UnregisteredEnumValue1 | UnregisteredEnumValue2)
|
||||
<< UnregisteredFlags(UnregisteredEnumValue1 | UnregisteredEnumValue3);
|
||||
QTest::newRow("fail2")
|
||||
<< UnregisteredFlags(UnregisteredEnumValue1)
|
||||
<< UnregisteredFlags(UnregisteredEnumValue1 | UnregisteredEnumValue3);
|
||||
}
|
||||
|
||||
void tst_Cmptest::test_unregistered_flags()
|
||||
{
|
||||
QFETCH(UnregisteredFlags, actualFlags);
|
||||
QFETCH(UnregisteredFlags, expectedFlags);
|
||||
QCOMPARE(actualFlags, expectedFlags);
|
||||
}
|
||||
|
||||
static bool boolfunc() { return true; }
|
||||
static bool boolfunc2() { return true; }
|
||||
|
||||
void tst_Cmptest::compare_boolfuncs()
|
||||
{
|
||||
QCOMPARE(boolfunc(), boolfunc());
|
||||
QCOMPARE(boolfunc(), boolfunc2());
|
||||
QCOMPARE(!boolfunc(), !boolfunc2());
|
||||
QCOMPARE(boolfunc(), true);
|
||||
QCOMPARE(!boolfunc(), false);
|
||||
}
|
||||
|
||||
namespace {
|
||||
template <typename T>
|
||||
T *null() noexcept { return nullptr; }
|
||||
}
|
||||
|
||||
void tst_Cmptest::compare_to_nullptr()
|
||||
{
|
||||
QCOMPARE(null<int>(), nullptr);
|
||||
QCOMPARE(null<const int>(), nullptr);
|
||||
QCOMPARE(null<volatile int>(), nullptr);
|
||||
QCOMPARE(null<const volatile int>(), nullptr);
|
||||
|
||||
QCOMPARE(nullptr, null<int>());
|
||||
QCOMPARE(nullptr, null<const int>());
|
||||
QCOMPARE(nullptr, null<volatile int>());
|
||||
QCOMPARE(nullptr, null<const volatile int>());
|
||||
}
|
||||
|
||||
static int i = 0;
|
||||
|
||||
static int *intptr() { return &i; }
|
||||
|
||||
void tst_Cmptest::compare_pointerfuncs()
|
||||
{
|
||||
QCOMPARE(intptr(), intptr());
|
||||
QCOMPARE(&i, &i);
|
||||
QCOMPARE(intptr(), &i);
|
||||
QCOMPARE(&i, intptr());
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQObjects()
|
||||
{
|
||||
QObject object1;
|
||||
object1.setObjectName(QStringLiteral("object1"));
|
||||
QObject object2;
|
||||
object2.setObjectName(QStringLiteral("object2"));
|
||||
QCOMPARE(&object1, &object1);
|
||||
QCOMPARE(&object1, &object2);
|
||||
QCOMPARE(&object1, nullptr);
|
||||
QCOMPARE(nullptr, &object2);
|
||||
}
|
||||
|
||||
struct PhonyClass
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
void tst_Cmptest::compare_tostring_data()
|
||||
{
|
||||
QTest::addColumn<QVariant>("actual");
|
||||
QTest::addColumn<QVariant>("expected");
|
||||
|
||||
QTest::newRow("int, string")
|
||||
<< QVariant::fromValue(123)
|
||||
<< QVariant::fromValue(QString("hi"))
|
||||
;
|
||||
|
||||
QTest::newRow("both invalid")
|
||||
<< QVariant()
|
||||
<< QVariant()
|
||||
;
|
||||
|
||||
QTest::newRow("null hash, invalid")
|
||||
<< QVariant(QMetaType(QMetaType::QVariantHash))
|
||||
<< QVariant()
|
||||
;
|
||||
|
||||
QTest::newRow("string, null user type")
|
||||
<< QVariant::fromValue(QString::fromLatin1("A simple string"))
|
||||
<< QVariant(QMetaType::fromType<PhonyClass>())
|
||||
;
|
||||
|
||||
PhonyClass fake1 = {1};
|
||||
PhonyClass fake2 = {2};
|
||||
QTest::newRow("both non-null user type")
|
||||
<< QVariant(QMetaType::fromType<PhonyClass>(), (const void*)&fake1)
|
||||
<< QVariant(QMetaType::fromType<PhonyClass>(), (const void*)&fake2)
|
||||
;
|
||||
}
|
||||
|
||||
void tst_Cmptest::compare_tostring()
|
||||
{
|
||||
QFETCH(QVariant, actual);
|
||||
QFETCH(QVariant, expected);
|
||||
|
||||
QCOMPARE(actual, expected);
|
||||
}
|
||||
|
||||
struct UnknownType
|
||||
{
|
||||
int value;
|
||||
bool operator==(const UnknownType &rhs) const { return value == rhs.value; }
|
||||
};
|
||||
|
||||
void tst_Cmptest::compare_unknown()
|
||||
{
|
||||
UnknownType a{1};
|
||||
UnknownType b{2};
|
||||
|
||||
QCOMPARE(a, b);
|
||||
}
|
||||
|
||||
struct CustomType
|
||||
{
|
||||
int value;
|
||||
bool operator==(const CustomType &rhs) const { return value == rhs.value; }
|
||||
};
|
||||
|
||||
QDebug operator<<(QDebug dbg, const CustomType &val)
|
||||
{
|
||||
dbg << "QDebug stream: " << val.value;
|
||||
return dbg;
|
||||
}
|
||||
|
||||
void tst_Cmptest::compare_textFromDebug()
|
||||
{
|
||||
CustomType a{0};
|
||||
CustomType b{1};
|
||||
|
||||
QCOMPARE(a, b);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQStringLists_data()
|
||||
{
|
||||
QTest::addColumn<QStringList>("opA");
|
||||
QTest::addColumn<QStringList>("opB");
|
||||
|
||||
{
|
||||
QStringList opA;
|
||||
QStringList opB(opA);
|
||||
|
||||
QTest::newRow("empty lists") << opA << opB;
|
||||
}
|
||||
|
||||
{
|
||||
QStringList opA;
|
||||
opA.append(QLatin1String("string1"));
|
||||
opA.append(QLatin1String("string2"));
|
||||
opA.append(QLatin1String("string3"));
|
||||
opA.append(QLatin1String("string4"));
|
||||
|
||||
QStringList opB(opA);
|
||||
|
||||
QTest::newRow("equal lists") << opA << opB;
|
||||
}
|
||||
|
||||
{
|
||||
QStringList opA;
|
||||
opA.append(QLatin1String("string1"));
|
||||
opA.append(QLatin1String("string2"));
|
||||
|
||||
QStringList opB(opA);
|
||||
opA.append(QLatin1String("string3"));
|
||||
opB.append(QLatin1String("DIFFERS"));
|
||||
|
||||
QTest::newRow("last item different") << opA << opB;
|
||||
}
|
||||
|
||||
{
|
||||
QStringList opA;
|
||||
opA.append(QLatin1String("string1"));
|
||||
opA.append(QLatin1String("string2"));
|
||||
|
||||
QStringList opB(opA);
|
||||
opA.append(QLatin1String("string3"));
|
||||
opA.append(QLatin1String("string4"));
|
||||
|
||||
opB.append(QLatin1String("DIFFERS"));
|
||||
opB.append(QLatin1String("string4"));
|
||||
|
||||
QTest::newRow("second-last item different") << opA << opB;
|
||||
}
|
||||
|
||||
{
|
||||
QStringList opA;
|
||||
opA.append(QLatin1String("string1"));
|
||||
opA.append(QLatin1String("string2"));
|
||||
|
||||
QStringList opB;
|
||||
opB.append(QLatin1String("string1"));
|
||||
|
||||
QTest::newRow("prefix") << opA << opB;
|
||||
}
|
||||
|
||||
{
|
||||
QStringList opA;
|
||||
opA.append(QLatin1String("openInNewWindow"));
|
||||
opA.append(QLatin1String("openInNewTab"));
|
||||
opA.append(QLatin1String("separator"));
|
||||
opA.append(QLatin1String("bookmark_add"));
|
||||
opA.append(QLatin1String("savelinkas"));
|
||||
opA.append(QLatin1String("copylinklocation"));
|
||||
opA.append(QLatin1String("separator"));
|
||||
opA.append(QLatin1String("openWith_submenu"));
|
||||
opA.append(QLatin1String("preview1"));
|
||||
opA.append(QLatin1String("actions_submenu"));
|
||||
opA.append(QLatin1String("separator"));
|
||||
opA.append(QLatin1String("viewDocumentSource"));
|
||||
|
||||
QStringList opB;
|
||||
opB.append(QLatin1String("viewDocumentSource"));
|
||||
|
||||
QTest::newRow("short list second") << opA << opB;
|
||||
|
||||
QTest::newRow("short list first") << opB << opA;
|
||||
}
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQStringLists()
|
||||
{
|
||||
QFETCH(QStringList, opA);
|
||||
QFETCH(QStringList, opB);
|
||||
|
||||
QCOMPARE(opA, opB);
|
||||
}
|
||||
|
||||
using IntList = QList<int>;
|
||||
|
||||
void tst_Cmptest::compareQListInt_data()
|
||||
{
|
||||
QTest::addColumn<IntList>("actual");
|
||||
|
||||
QTest::newRow("match") << IntList{1, 2, 3};
|
||||
QTest::newRow("size mismatch") << IntList{1, 2};
|
||||
QTest::newRow("value mismatch") << IntList{1, 2, 4};
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQListInt()
|
||||
{
|
||||
QFETCH(IntList, actual);
|
||||
const QList<int> expected{1, 2, 3};
|
||||
QCOMPARE(actual, expected);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQListIntToArray_data()
|
||||
{
|
||||
compareQListInt_data();
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQListIntToArray()
|
||||
{
|
||||
QFETCH(IntList, actual);
|
||||
const int expected[] = {1, 2, 3};
|
||||
QCOMPARE(actual, expected);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQListIntToInitializerList_data()
|
||||
{
|
||||
compareQListInt_data();
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQListIntToInitializerList()
|
||||
{
|
||||
QFETCH(IntList, actual);
|
||||
// Protect ',' in the list
|
||||
#define ARG(...) __VA_ARGS__
|
||||
QCOMPARE(actual, ARG({1, 2, 3}));
|
||||
#undef ARG
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQListDouble()
|
||||
{
|
||||
QList<double> double1; double1 << 1.5 << 2 << 3;
|
||||
QList<double> double2; double2 << 1 << 2 << 4;
|
||||
QCOMPARE(double1, double2);
|
||||
}
|
||||
|
||||
#ifdef QT_GUI_LIB
|
||||
void tst_Cmptest::compareQColor_data()
|
||||
{
|
||||
QTest::addColumn<QColor>("colorA");
|
||||
QTest::addColumn<QColor>("colorB");
|
||||
|
||||
QTest::newRow("Qt::yellow vs \"yellow\"") << QColor(Qt::yellow) << QColor(QStringLiteral("yellow"));
|
||||
QTest::newRow("Qt::yellow vs Qt::green") << QColor(Qt::yellow) << QColor(Qt::green);
|
||||
QTest::newRow("0x88ff0000 vs 0xffff0000") << QColor::fromRgba(0x88ff0000) << QColor::fromRgba(0xffff0000);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQColor()
|
||||
{
|
||||
QFETCH(QColor, colorA);
|
||||
QFETCH(QColor, colorB);
|
||||
|
||||
QCOMPARE(colorA, colorB);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQPixmaps_data()
|
||||
{
|
||||
QTest::addColumn<QPixmap>("opA");
|
||||
QTest::addColumn<QPixmap>("opB");
|
||||
|
||||
const QPixmap pixmap1(xpmPixmapData1);
|
||||
const QPixmap pixmap2(xpmPixmapData2);
|
||||
const QPixmap pixmap3(xpmPixmapData3);
|
||||
QPixmap pixmapWrongDpr = pixmap1.scaled(2, 2);
|
||||
pixmapWrongDpr.setDevicePixelRatio(2);
|
||||
|
||||
QTest::newRow("both null") << QPixmap() << QPixmap();
|
||||
QTest::newRow("one null") << QPixmap() << pixmap1;
|
||||
QTest::newRow("other null") << pixmap1 << QPixmap();
|
||||
QTest::newRow("equal") << pixmap1 << pixmap1;
|
||||
QTest::newRow("different size") << pixmap1 << pixmap3;
|
||||
QTest::newRow("different pixels") << pixmap1 << pixmap2;
|
||||
QTest::newRow("different dpr") << pixmap1 << pixmapWrongDpr;
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQPixmaps()
|
||||
{
|
||||
QFETCH(QPixmap, opA);
|
||||
QFETCH(QPixmap, opB);
|
||||
|
||||
QCOMPARE(opA, opB);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQImages_data()
|
||||
{
|
||||
QTest::addColumn<QImage>("opA");
|
||||
QTest::addColumn<QImage>("opB");
|
||||
|
||||
const QImage image1(QPixmap(xpmPixmapData1).toImage());
|
||||
const QImage image2(QPixmap(xpmPixmapData2).toImage());
|
||||
const QImage image1Indexed = image1.convertToFormat(QImage::Format_Indexed8);
|
||||
const QImage image3(QPixmap(xpmPixmapData3).toImage());
|
||||
QImage imageWrongDpr = image1.scaled(2, 2);
|
||||
imageWrongDpr.setDevicePixelRatio(2);
|
||||
|
||||
QTest::newRow("both null") << QImage() << QImage();
|
||||
QTest::newRow("one null") << QImage() << image1;
|
||||
QTest::newRow("other null") << image1 << QImage();
|
||||
QTest::newRow("equal") << image1 << image1;
|
||||
QTest::newRow("different size") << image1 << image3;
|
||||
QTest::newRow("different format") << image1 << image1Indexed;
|
||||
QTest::newRow("different pixels") << image1 << image2;
|
||||
QTest::newRow("different dpr") << image1 << imageWrongDpr;
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQImages()
|
||||
{
|
||||
QFETCH(QImage, opA);
|
||||
QFETCH(QImage, opB);
|
||||
|
||||
QCOMPARE(opA, opB);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQRegion_data()
|
||||
{
|
||||
QTest::addColumn<QRegion>("rA");
|
||||
QTest::addColumn<QRegion>("rB");
|
||||
const QRect rect1(QPoint(10, 10), QSize(200, 50));
|
||||
const QRegion region1(rect1);
|
||||
QRegion listRegion2;
|
||||
const QList<QRect> list2 = QList<QRect>() << QRect(QPoint(100, 200), QSize(50, 200)) << rect1;
|
||||
listRegion2.setRects(list2.constData(), list2.size());
|
||||
QTest::newRow("equal-empty") << QRegion() << QRegion();
|
||||
QTest::newRow("1-empty") << region1 << QRegion();
|
||||
QTest::newRow("equal") << region1 << region1;
|
||||
QTest::newRow("different lists") << region1 << listRegion2;
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQRegion()
|
||||
{
|
||||
QFETCH(QRegion, rA);
|
||||
QFETCH(QRegion, rB);
|
||||
|
||||
QCOMPARE(rA, rB);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQVector2D()
|
||||
{
|
||||
QVector2D v2a{1, 2};
|
||||
QVector2D v2b = v2a;
|
||||
QCOMPARE(v2a, v2b);
|
||||
v2b.setY(3);
|
||||
QCOMPARE(v2a, v2b);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQVector3D()
|
||||
{
|
||||
QVector3D v3a{1, 2, 3};
|
||||
QVector3D v3b = v3a;
|
||||
QCOMPARE(v3a, v3b);
|
||||
v3b.setY(3);
|
||||
QCOMPARE(v3a, v3b);
|
||||
}
|
||||
|
||||
void tst_Cmptest::compareQVector4D()
|
||||
{
|
||||
QVector4D v4a{1, 2, 3, 4};
|
||||
QVector4D v4b = v4a;
|
||||
QCOMPARE(v4a, v4b);
|
||||
v4b.setY(3);
|
||||
QCOMPARE(v4a, v4b);
|
||||
}
|
||||
#endif // QT_GUI_LIB
|
||||
|
||||
static int opaqueFunc()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
|
||||
void tst_Cmptest::verify()
|
||||
{
|
||||
QVERIFY(opaqueFunc() > 2);
|
||||
QVERIFY(opaqueFunc() < 2);
|
||||
}
|
||||
|
||||
void tst_Cmptest::verify2()
|
||||
{
|
||||
QVERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData());
|
||||
QVERIFY2(opaqueFunc() < 2,
|
||||
// Message with parenthetical part, to catch mis-parses of the
|
||||
// resulting message:
|
||||
u"%1 >= 2 (as expected, in fact)"_s.arg(opaqueFunc()).toUtf8().constData());
|
||||
}
|
||||
|
||||
class DeferredFlag : public QObject // Can't be const.
|
||||
{
|
||||
Q_OBJECT
|
||||
bool m_flag;
|
||||
public:
|
||||
// A boolean that either starts out true or decays to true after 50 ms.
|
||||
// However, that decay will only happen when the event loop is run.
|
||||
explicit DeferredFlag(bool initial = false) : m_flag(initial)
|
||||
{
|
||||
if (!initial)
|
||||
QTimer::singleShot(50, this, &DeferredFlag::onTimeOut);
|
||||
}
|
||||
explicit operator bool() const { return m_flag; }
|
||||
bool operator!() const { return !m_flag; }
|
||||
friend bool operator==(const DeferredFlag &a, const DeferredFlag &b)
|
||||
{
|
||||
return bool(a) == bool(b);
|
||||
}
|
||||
public slots:
|
||||
void onTimeOut() { m_flag = true; }
|
||||
};
|
||||
|
||||
char *toString(const DeferredFlag &val)
|
||||
{
|
||||
return qstrdup(bool(val) ? "DeferredFlag(true)" : "DeferredFlag(false)");
|
||||
}
|
||||
|
||||
void tst_Cmptest::tryCompare()
|
||||
{
|
||||
/* Note that expected values given as DeferredFlag() shall be re-evaluated
|
||||
each time the comparison is checked, hence supply a fresh false instance,
|
||||
that'll be discarded before it has a chance to decay, hence only compare
|
||||
equal to a false instance. Do not replace them with a local variable
|
||||
initialized to false, as it would (of course) decay.
|
||||
*/
|
||||
DeferredFlag trueAlready(true);
|
||||
{
|
||||
DeferredFlag c;
|
||||
// QTRY should check before looping, so be equal to the fresh false immediately.
|
||||
QTRY_COMPARE(c, DeferredFlag());
|
||||
// Given time, it'll end up equal to a true one.
|
||||
QTRY_COMPARE(c, trueAlready);
|
||||
}
|
||||
{
|
||||
DeferredFlag c;
|
||||
QTRY_COMPARE_WITH_TIMEOUT(c, DeferredFlag(), 300);
|
||||
QVERIFY(!c); // Instantly equal, so succeeded without delay.
|
||||
QTRY_COMPARE_WITH_TIMEOUT(c, trueAlready, 200);
|
||||
qInfo("Should now time out and fail");
|
||||
QTRY_COMPARE_WITH_TIMEOUT(c, DeferredFlag(), 200);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_Cmptest::tryVerify()
|
||||
{
|
||||
{
|
||||
DeferredFlag c;
|
||||
QTRY_VERIFY(!c);
|
||||
QTRY_VERIFY(c);
|
||||
}
|
||||
{
|
||||
DeferredFlag c;
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!c, 300);
|
||||
QTRY_VERIFY_WITH_TIMEOUT(c, 200);
|
||||
qInfo("Should now time out and fail");
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!c, 200);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_Cmptest::tryVerify2()
|
||||
{
|
||||
{
|
||||
DeferredFlag c;
|
||||
QTRY_VERIFY2(!c, "Failed to check before looping");
|
||||
QTRY_VERIFY2(c, "Failed to trigger single-shot");
|
||||
}
|
||||
{
|
||||
DeferredFlag c;
|
||||
QTRY_VERIFY2_WITH_TIMEOUT(!c, "Failed to check before looping", 300);
|
||||
QTRY_VERIFY2_WITH_TIMEOUT(c, "Failed to trigger single-shot", 200);
|
||||
QTRY_VERIFY2_WITH_TIMEOUT(!c, "Should time out and fail", 200);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_Cmptest::verifyExplicitOperatorBool()
|
||||
{
|
||||
struct ExplicitOperatorBool {
|
||||
int m_i;
|
||||
explicit ExplicitOperatorBool(int i) : m_i(i) {}
|
||||
explicit operator bool() const { return m_i > 0; }
|
||||
bool operator !() const { return !bool(*this); }
|
||||
};
|
||||
|
||||
ExplicitOperatorBool val1(42);
|
||||
QVERIFY(val1);
|
||||
|
||||
ExplicitOperatorBool val2(-273);
|
||||
QVERIFY(!val2);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_Cmptest)
|
||||
#include "tst_cmptest.moc"
|
20
tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## commandlinedata Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(commandlinedata
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_commandlinedata.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(commandlinedata)
|
@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
/*!
|
||||
\internal
|
||||
\since 4.4
|
||||
\brief Tests that reporting of tables are done in a certain way.
|
||||
*/
|
||||
class tst_DataTable: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
|
||||
void fiveTablePasses() const;
|
||||
void fiveTablePasses_data() const;
|
||||
};
|
||||
|
||||
void tst_DataTable::fiveTablePasses() const
|
||||
{
|
||||
QFETCH(bool, test);
|
||||
|
||||
QVERIFY(test);
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveTablePasses_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
QTest::newRow("fiveTablePasses_data1") << true;
|
||||
QTest::newRow("fiveTablePasses_data2") << true;
|
||||
QTest::newRow("fiveTablePasses_data3") << true;
|
||||
QTest::newRow("fiveTablePasses_data4") << true;
|
||||
QTest::newRow("fiveTablePasses_data5") << true;
|
||||
}
|
||||
|
||||
QTEST_MAIN_WRAPPER(tst_DataTable,
|
||||
std::vector<const char*> args(argv, argv + argc);
|
||||
args.push_back("fiveTablePasses");
|
||||
args.push_back("fiveTablePasses:fiveTablePasses_data1");
|
||||
args.push_back("-v2");
|
||||
argc = int(args.size());
|
||||
argv = const_cast<char**>(&args[0]);
|
||||
QTEST_MAIN_SETUP())
|
||||
|
||||
#include "tst_commandlinedata.moc"
|
20
tests/auto/testlib/selftests/counting/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/counting/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## counting Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(counting
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_counting.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(counting)
|
282
tests/auto/testlib/selftests/counting/tst_counting.cpp
Normal file
282
tests/auto/testlib/selftests/counting/tst_counting.cpp
Normal file
@ -0,0 +1,282 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_Counting : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
// The following test functions exercise each possible combination of test
|
||||
// results for two data rows.
|
||||
void testPassPass_data();
|
||||
void testPassPass();
|
||||
|
||||
void testPassSkip_data();
|
||||
void testPassSkip();
|
||||
|
||||
void testPassFail_data();
|
||||
void testPassFail();
|
||||
|
||||
void testSkipPass_data();
|
||||
void testSkipPass();
|
||||
|
||||
void testSkipSkip_data();
|
||||
void testSkipSkip();
|
||||
|
||||
void testSkipFail_data();
|
||||
void testSkipFail();
|
||||
|
||||
void testFailPass_data();
|
||||
void testFailPass();
|
||||
|
||||
void testFailSkip_data();
|
||||
void testFailSkip();
|
||||
|
||||
void testFailFail_data();
|
||||
void testFailFail();
|
||||
|
||||
// The following test functions test skips and fails in the special
|
||||
// init() and cleanup() slots.
|
||||
void init();
|
||||
void cleanup();
|
||||
void testFailInInit_data();
|
||||
void testFailInInit();
|
||||
void testFailInCleanup_data();
|
||||
void testFailInCleanup();
|
||||
void testSkipInInit_data();
|
||||
void testSkipInInit();
|
||||
void testSkipInCleanup_data();
|
||||
void testSkipInCleanup();
|
||||
|
||||
private:
|
||||
void helper();
|
||||
};
|
||||
|
||||
enum TestResult
|
||||
{
|
||||
Pass,
|
||||
Fail,
|
||||
Skip
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(TestResult);
|
||||
|
||||
void tst_Counting::helper()
|
||||
{
|
||||
QFETCH(TestResult, result);
|
||||
|
||||
switch (result) {
|
||||
case Pass:
|
||||
QVERIFY(true);
|
||||
QCOMPARE(2 + 1, 3);
|
||||
break;
|
||||
case Fail:
|
||||
QVERIFY(false);
|
||||
break;
|
||||
case Skip:
|
||||
QSKIP("Skipping");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void tst_Counting::testPassPass_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Pass;
|
||||
QTest::newRow("row 2") << Pass;
|
||||
}
|
||||
|
||||
void tst_Counting::testPassPass()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testPassSkip_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Pass;
|
||||
QTest::newRow("row 2") << Skip;
|
||||
}
|
||||
|
||||
void tst_Counting::testPassSkip()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testPassFail_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Pass;
|
||||
QTest::newRow("row 2") << Fail;
|
||||
}
|
||||
|
||||
void tst_Counting::testPassFail()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipPass_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Skip;
|
||||
QTest::newRow("row 2") << Pass;
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipPass()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipSkip_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Skip;
|
||||
QTest::newRow("row 2") << Skip;
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipSkip()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipFail_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Skip;
|
||||
QTest::newRow("row 2") << Fail;
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipFail()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testFailPass_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Fail;
|
||||
QTest::newRow("row 2") << Pass;
|
||||
}
|
||||
|
||||
void tst_Counting::testFailPass()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testFailSkip_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Fail;
|
||||
QTest::newRow("row 2") << Skip;
|
||||
}
|
||||
|
||||
void tst_Counting::testFailSkip()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::testFailFail_data()
|
||||
{
|
||||
QTest::addColumn<TestResult>("result");
|
||||
QTest::newRow("row 1") << Fail;
|
||||
QTest::newRow("row 2") << Fail;
|
||||
}
|
||||
|
||||
void tst_Counting::testFailFail()
|
||||
{
|
||||
helper();
|
||||
}
|
||||
|
||||
void tst_Counting::init()
|
||||
{
|
||||
if (strcmp(QTest::currentTestFunction(), "testFailInInit") == 0
|
||||
&& strcmp(QTest::currentDataTag(), "fail") == 0) {
|
||||
QFAIL("Fail in init()");
|
||||
} else if (strcmp(QTest::currentTestFunction(), "testSkipInInit") == 0
|
||||
&& strcmp(QTest::currentDataTag(), "skip") == 0) {
|
||||
QSKIP("Skip in init()");
|
||||
}
|
||||
}
|
||||
|
||||
void tst_Counting::cleanup()
|
||||
{
|
||||
if (strcmp(QTest::currentTestFunction(), "testFailInCleanup") == 0 && strcmp(QTest::currentDataTag(), "fail") == 0)
|
||||
QFAIL("Fail in cleanup()");
|
||||
else if (strcmp(QTest::currentTestFunction(), "testSkipInCleanup") == 0 && strcmp(QTest::currentDataTag(), "skip") == 0)
|
||||
QSKIP("Skip in cleanup()");
|
||||
}
|
||||
|
||||
void tst_Counting::testFailInInit_data()
|
||||
{
|
||||
QTest::addColumn<bool>("dummy");
|
||||
QTest::newRow("before") << true;
|
||||
QTest::newRow("fail") << true;
|
||||
QTest::newRow("after") << true;
|
||||
}
|
||||
|
||||
void tst_Counting::testFailInInit()
|
||||
{
|
||||
if (strcmp(QTest::currentDataTag(), "fail") == 0)
|
||||
QFAIL("This test function should have been skipped due to QFAIL in init()");
|
||||
}
|
||||
|
||||
void tst_Counting::testFailInCleanup_data()
|
||||
{
|
||||
QTest::addColumn<bool>("dummy");
|
||||
QTest::newRow("before") << true;
|
||||
QTest::newRow("fail") << true;
|
||||
QTest::newRow("after") << true;
|
||||
}
|
||||
|
||||
void tst_Counting::testFailInCleanup()
|
||||
{
|
||||
if (strcmp(QTest::currentDataTag(), "fail") == 0)
|
||||
qDebug() << "This test function should execute and then QFAIL in cleanup()";
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipInInit_data()
|
||||
{
|
||||
QTest::addColumn<bool>("dummy");
|
||||
QTest::newRow("before") << true;
|
||||
QTest::newRow("skip") << true;
|
||||
QTest::newRow("after") << true;
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipInInit()
|
||||
{
|
||||
if (strcmp(QTest::currentDataTag(), "skip") == 0)
|
||||
QFAIL("This test function should have been skipped due to QSKIP in init()");
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipInCleanup_data()
|
||||
{
|
||||
QTest::addColumn<bool>("dummy");
|
||||
QTest::newRow("before") << true;
|
||||
QTest::newRow("skip") << true;
|
||||
QTest::newRow("after") << true;
|
||||
}
|
||||
|
||||
void tst_Counting::testSkipInCleanup()
|
||||
{
|
||||
if (strcmp(QTest::currentDataTag(), "skip") == 0)
|
||||
qDebug() << "This test function should execute and then QSKIP in cleanup()";
|
||||
}
|
||||
|
||||
#ifdef TESTLIB_VERBOSITY_ARG
|
||||
#define SETUP() \
|
||||
std::vector<const char*> args(argv, argv + argc); \
|
||||
args.push_back(QT_STRINGIFY(TESTLIB_VERBOSITY_ARG)); \
|
||||
argc = int(args.size()); \
|
||||
argv = const_cast<char**>(&args[0]);
|
||||
#else
|
||||
#define SETUP()
|
||||
#endif
|
||||
|
||||
QTEST_MAIN_WRAPPER(tst_Counting,
|
||||
SETUP()
|
||||
QTEST_MAIN_SETUP())
|
||||
|
||||
#include "tst_counting.moc"
|
20
tests/auto/testlib/selftests/crashes/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/crashes/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## crashes Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(crashes
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_crashes.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(crashes)
|
46
tests/auto/testlib/selftests/crashes/tst_crashes.cpp
Normal file
46
tests/auto/testlib/selftests/crashes/tst_crashes.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#else
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
class tst_Crashes: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void crash();
|
||||
};
|
||||
|
||||
void tst_Crashes::crash()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
//we avoid the error dialogbox to appear on windows
|
||||
SetErrorMode( SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
|
||||
#elif defined(RLIMIT_CORE)
|
||||
// Unix: set our core dump limit to zero to request no dialogs.
|
||||
if (struct rlimit rlim; getrlimit(RLIMIT_CORE, &rlim) == 0) {
|
||||
rlim.rlim_cur = 0;
|
||||
setrlimit(RLIMIT_CORE, &rlim);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
We deliberately dereference an invalid but non-zero address;
|
||||
it should be non-zero because a few platforms may have special crash behavior
|
||||
when dereferencing exactly 0 (e.g. some macs have been observed to generate SIGILL
|
||||
rather than SIGSEGV).
|
||||
*/
|
||||
int *i = 0;
|
||||
i[1] = 1;
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_Crashes)
|
||||
|
||||
#include "tst_crashes.moc"
|
20
tests/auto/testlib/selftests/datatable/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/datatable/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## datatable Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(datatable
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_datatable.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(datatable)
|
151
tests/auto/testlib/selftests/datatable/tst_datatable.cpp
Normal file
151
tests/auto/testlib/selftests/datatable/tst_datatable.cpp
Normal file
@ -0,0 +1,151 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
/*!
|
||||
\internal
|
||||
\since 4.4
|
||||
\brief Tests that reporting of tables are done in a certain way.
|
||||
*/
|
||||
class tst_DataTable: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void singleTestFunction1() const;
|
||||
void singleTestFunction2() const;
|
||||
|
||||
void fiveTablePasses() const;
|
||||
void fiveTablePasses_data() const;
|
||||
void fiveTableFailures() const;
|
||||
void fiveTableFailures_data() const;
|
||||
|
||||
void startsWithFailure() const;
|
||||
void startsWithFailure_data() const;
|
||||
|
||||
void endsWithFailure() const;
|
||||
void endsWithFailure_data() const;
|
||||
|
||||
void failureInMiddle() const;
|
||||
void failureInMiddle_data() const;
|
||||
|
||||
void fiveIsolatedFailures() const;
|
||||
void fiveIsolatedFailures_data() const;
|
||||
};
|
||||
|
||||
void tst_DataTable::singleTestFunction1() const
|
||||
{
|
||||
/* Do nothing, just pass. */
|
||||
}
|
||||
|
||||
void tst_DataTable::singleTestFunction2() const
|
||||
{
|
||||
/* Do nothing, just pass. */
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveTableFailures() const
|
||||
{
|
||||
QFETCH(bool, test);
|
||||
|
||||
QVERIFY(test);
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveTableFailures_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
/* Unconditionally fail. */
|
||||
QTest::newRow("fiveTableFailures_data 1") << false;
|
||||
QTest::newRow("fiveTableFailures_data 2") << false;
|
||||
QTest::newRow("fiveTableFailures_data 3") << false;
|
||||
QTest::newRow("fiveTableFailures_data 4") << false;
|
||||
QTest::newRow("fiveTableFailures_data 5") << false;
|
||||
}
|
||||
|
||||
void tst_DataTable::startsWithFailure() const
|
||||
{
|
||||
fiveTableFailures();
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveTablePasses() const
|
||||
{
|
||||
fiveTableFailures();
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveTablePasses_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
QTest::newRow("fiveTablePasses_data 1") << true;
|
||||
QTest::newRow("fiveTablePasses_data 2") << true;
|
||||
QTest::newRow("fiveTablePasses_data 3") << true;
|
||||
QTest::newRow("fiveTablePasses_data 4") << true;
|
||||
QTest::newRow("fiveTablePasses_data 5") << true;
|
||||
}
|
||||
|
||||
void tst_DataTable::startsWithFailure_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
QTest::newRow("startsWithFailure_data 1") << false;
|
||||
QTest::newRow("startsWithFailure_data 2") << true;
|
||||
QTest::newRow("startsWithFailure_data 3") << true;
|
||||
QTest::newRow("startsWithFailure_data 4") << true;
|
||||
QTest::newRow("startsWithFailure_data 5") << true;
|
||||
}
|
||||
|
||||
void tst_DataTable::endsWithFailure() const
|
||||
{
|
||||
fiveTableFailures();
|
||||
}
|
||||
|
||||
void tst_DataTable::endsWithFailure_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
QTest::newRow("endsWithFailure 1") << true;
|
||||
QTest::newRow("endsWithFailure 2") << true;
|
||||
QTest::newRow("endsWithFailure 3") << true;
|
||||
QTest::newRow("endsWithFailure 4") << true;
|
||||
QTest::newRow("endsWithFailure 5") << false;
|
||||
}
|
||||
|
||||
void tst_DataTable::failureInMiddle() const
|
||||
{
|
||||
fiveTableFailures();
|
||||
}
|
||||
|
||||
void tst_DataTable::failureInMiddle_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
QTest::newRow("failureInMiddle_data 1") << true;
|
||||
QTest::newRow("failureInMiddle_data 2") << true;
|
||||
QTest::newRow("failureInMiddle_data 3") << false;
|
||||
QTest::newRow("failureInMiddle_data 4") << true;
|
||||
QTest::newRow("failureInMiddle_data 5") << true;
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveIsolatedFailures() const
|
||||
{
|
||||
QFETCH(bool, test);
|
||||
QVERIFY(!test);
|
||||
}
|
||||
|
||||
void tst_DataTable::fiveIsolatedFailures_data() const
|
||||
{
|
||||
QTest::addColumn<bool>("test");
|
||||
|
||||
QTest::newRow("fiveIsolatedFailures_data 1") << true;
|
||||
QTest::newRow("fiveIsolatedFailures_data 2") << true;
|
||||
QTest::newRow("fiveIsolatedFailures_data 3") << true;
|
||||
QTest::newRow("fiveIsolatedFailures_data 4") << true;
|
||||
QTest::newRow("fiveIsolatedFailures_data 5") << true;
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_DataTable)
|
||||
|
||||
#include "tst_datatable.moc"
|
20
tests/auto/testlib/selftests/datetime/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/datetime/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## datetime Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(datetime
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_datetime.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(datetime)
|
54
tests/auto/testlib/selftests/datetime/tst_datetime.cpp
Normal file
54
tests/auto/testlib/selftests/datetime/tst_datetime.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QTimeZone>
|
||||
#include <QTest>
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
class tst_DateTime: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void dateTime() const;
|
||||
void qurl() const;
|
||||
void qurl_data() const;
|
||||
};
|
||||
|
||||
void tst_DateTime::dateTime() const
|
||||
{
|
||||
const auto twoMinutes = std::chrono::minutes{2};
|
||||
const QDateTime utc(QDate(2000, 5, 3), QTime(4, 3, 4), QTimeZone::UTC);
|
||||
const QDateTime local(QDate(2000, 5, 3), QTime(4, 3, 4),
|
||||
QTimeZone::fromDurationAheadOfUtc(twoMinutes));
|
||||
|
||||
QCOMPARE(local, utc);
|
||||
}
|
||||
|
||||
void tst_DateTime::qurl() const
|
||||
{
|
||||
QFETCH(QUrl, operandA);
|
||||
QFETCH(QUrl, operandB);
|
||||
|
||||
QCOMPARE(operandA, operandB);
|
||||
}
|
||||
|
||||
void tst_DateTime::qurl_data() const
|
||||
{
|
||||
QTest::addColumn<QUrl>("operandA");
|
||||
QTest::addColumn<QUrl>("operandB");
|
||||
|
||||
QTest::newRow("empty urls") << QUrl() << QUrl();
|
||||
QTest::newRow("empty rhs") << QUrl(QLatin1String("http://example.com")) << QUrl();
|
||||
QTest::newRow("empty lhs") << QUrl() << QUrl(QLatin1String("http://example.com"));
|
||||
QTest::newRow("same urls") << QUrl(QLatin1String("http://example.com")) << QUrl(QLatin1String("http://example.com"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_DateTime)
|
||||
|
||||
#include "tst_datetime.moc"
|
17
tests/auto/testlib/selftests/deleteLater/CMakeLists.txt
Normal file
17
tests/auto/testlib/selftests/deleteLater/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## deleteLater Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(deleteLater
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_deleteLater.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(deleteLater)
|
62
tests/auto/testlib/selftests/deleteLater/tst_deleteLater.cpp
Normal file
62
tests/auto/testlib/selftests/deleteLater/tst_deleteLater.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (C) 2017 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_DeleteLater: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void qtestLibShouldFlushDeleteLaterBetweenTests_setup();
|
||||
void qtestLibShouldFlushDeleteLaterBetweenTests_check();
|
||||
void qtestLibShouldFlushDeleteLaterOnExit();
|
||||
};
|
||||
|
||||
class ToBeDeleted : public QObject
|
||||
{
|
||||
public:
|
||||
ToBeDeleted(bool *staticBool) : staticBool(staticBool) {}
|
||||
~ToBeDeleted() { *staticBool = true; }
|
||||
private:
|
||||
bool *staticBool;
|
||||
};
|
||||
|
||||
static bool deletedBetweenTests = false;
|
||||
|
||||
void tst_DeleteLater::qtestLibShouldFlushDeleteLaterBetweenTests_setup()
|
||||
{
|
||||
ToBeDeleted *obj = new ToBeDeleted(&deletedBetweenTests);
|
||||
obj->deleteLater();
|
||||
}
|
||||
|
||||
void tst_DeleteLater::qtestLibShouldFlushDeleteLaterBetweenTests_check()
|
||||
{
|
||||
QVERIFY(deletedBetweenTests);
|
||||
}
|
||||
|
||||
static bool deletedOnExit = false;
|
||||
|
||||
void tst_DeleteLater::qtestLibShouldFlushDeleteLaterOnExit()
|
||||
{
|
||||
ToBeDeleted *obj = new ToBeDeleted(&deletedOnExit);
|
||||
obj->deleteLater();
|
||||
}
|
||||
|
||||
// This global object will check whether the deleteLater was processed
|
||||
class DeleteChecker
|
||||
{
|
||||
public:
|
||||
~DeleteChecker() {
|
||||
if (!deletedOnExit) {
|
||||
qFatal("QTestLib failed to flush deleteLater on exit");
|
||||
}
|
||||
}
|
||||
};
|
||||
static DeleteChecker s_deleteChecker;
|
||||
|
||||
QTEST_MAIN(tst_DeleteLater)
|
||||
|
||||
#include "tst_deleteLater.moc"
|
@ -0,0 +1,17 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## deleteLater_noApp Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(deleteLater_noApp
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_deleteLater_noApp.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(deleteLater_noApp)
|
@ -0,0 +1,63 @@
|
||||
// Copyright (C) 2017 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QTest>
|
||||
|
||||
class tst_DeleteLater_noApp: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void qtestLibShouldNotFlushDeleteLaterBetweenTests_setup();
|
||||
void qtestLibShouldNotFlushDeleteLaterBetweenTests_check();
|
||||
void qtestLibShouldNotFlushDeleteLaterOnExit();
|
||||
};
|
||||
|
||||
class ToBeDeleted : public QObject
|
||||
{
|
||||
public:
|
||||
ToBeDeleted(bool *staticBool) : staticBool(staticBool) {}
|
||||
~ToBeDeleted() { *staticBool = true; }
|
||||
private:
|
||||
bool *staticBool;
|
||||
};
|
||||
|
||||
static bool deletedBetweenTests = false;
|
||||
|
||||
void tst_DeleteLater_noApp::qtestLibShouldNotFlushDeleteLaterBetweenTests_setup()
|
||||
{
|
||||
ToBeDeleted *obj = new ToBeDeleted(&deletedBetweenTests);
|
||||
obj->deleteLater();
|
||||
}
|
||||
|
||||
void tst_DeleteLater_noApp::qtestLibShouldNotFlushDeleteLaterBetweenTests_check()
|
||||
{
|
||||
// There's no qApp, we can't flush the events
|
||||
QVERIFY(!deletedBetweenTests);
|
||||
}
|
||||
|
||||
static bool deletedOnExit = false;
|
||||
|
||||
void tst_DeleteLater_noApp::qtestLibShouldNotFlushDeleteLaterOnExit()
|
||||
{
|
||||
ToBeDeleted *obj = new ToBeDeleted(&deletedOnExit);
|
||||
obj->deleteLater();
|
||||
}
|
||||
|
||||
// This global object will check whether the deleteLater was processed
|
||||
class DeleteChecker
|
||||
{
|
||||
public:
|
||||
~DeleteChecker() {
|
||||
if (deletedOnExit) {
|
||||
qFatal("QTestLib somehow flushed deleteLater on exit, without a qApp?");
|
||||
}
|
||||
}
|
||||
};
|
||||
static DeleteChecker s_deleteChecker;
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_DeleteLater_noApp)
|
||||
|
||||
#include "tst_deleteLater_noApp.moc"
|
20
tests/auto/testlib/selftests/differentexec/CMakeLists.txt
Normal file
20
tests/auto/testlib/selftests/differentexec/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## differentexec Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(differentexec
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_differentexec.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(differentexec)
|
@ -0,0 +1,54 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QTest>
|
||||
|
||||
class tst_TestA : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void slotName() const
|
||||
{
|
||||
QVERIFY(true);
|
||||
}
|
||||
|
||||
void aDifferentSlot() const
|
||||
{
|
||||
QVERIFY(false);
|
||||
}
|
||||
};
|
||||
|
||||
class tst_TestB : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void slotName() const
|
||||
{
|
||||
QVERIFY(true);
|
||||
}
|
||||
|
||||
void aSecondDifferentSlot() const
|
||||
{
|
||||
QVERIFY(false);
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
char *argv[] = { const_cast<char *>("appName"), const_cast<char *>("slotName") };
|
||||
int argc = 2;
|
||||
|
||||
tst_TestA testA;
|
||||
QTest::qExec(&testA, argc, argv);
|
||||
QTest::qExec(&testA, argc, argv);
|
||||
|
||||
tst_TestB testB;
|
||||
QTest::qExec(&testB, argc, argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "tst_differentexec.moc"
|
16
tests/auto/testlib/selftests/eventloop/CMakeLists.txt
Normal file
16
tests/auto/testlib/selftests/eventloop/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
#####################################################################
|
||||
## eventloop Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(eventloop
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_eventloop.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
qt_internal_apply_testlib_coverage_options(eventloop)
|
104
tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp
Normal file
104
tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp
Normal file
@ -0,0 +1,104 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
#include <QTestEventLoop>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
// Tests for QTestEventLoop (and some QTRY_* details)
|
||||
class tst_EventLoop: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
bool m_inTestFunction = false;
|
||||
private slots:
|
||||
void cleanup();
|
||||
void fail();
|
||||
void skip();
|
||||
void pass();
|
||||
};
|
||||
|
||||
class DeferredFlag : public QObject // Can't be const.
|
||||
{
|
||||
Q_OBJECT
|
||||
bool m_flag;
|
||||
public:
|
||||
// A boolean that either starts out true or decays to true after 50 ms.
|
||||
// However, that decay will only happen when the event loop is run.
|
||||
explicit DeferredFlag(bool initial = false) : m_flag(initial)
|
||||
{
|
||||
if (!initial)
|
||||
QTimer::singleShot(50, this, &DeferredFlag::onTimeOut);
|
||||
}
|
||||
explicit operator bool() const { return m_flag; }
|
||||
bool operator!() const { return !m_flag; }
|
||||
friend bool operator==(const DeferredFlag &a, const DeferredFlag &b)
|
||||
{
|
||||
return bool(a) == bool(b);
|
||||
}
|
||||
public slots:
|
||||
void onTimeOut() { m_flag = true; }
|
||||
};
|
||||
|
||||
char *toString(const DeferredFlag &val)
|
||||
{
|
||||
return qstrdup(bool(val) ? "DeferredFlag(true)" : "DeferredFlag(false)");
|
||||
}
|
||||
|
||||
void tst_EventLoop::cleanup()
|
||||
{
|
||||
// QTBUG-104441: looping didn't happen in cleanup() if test failed or skipped.
|
||||
{
|
||||
DeferredFlag flag;
|
||||
auto &loop = QTestEventLoop::instance();
|
||||
loop.enterLoopMSecs(100);
|
||||
QVERIFY2(loop.timeout(), "QTestEventLoop exited prematurely in cleanup()");
|
||||
QVERIFY(flag);
|
||||
}
|
||||
{
|
||||
DeferredFlag flag;
|
||||
QTRY_VERIFY2(flag, "QTRY_* loop exited prematurely in cleanup()");
|
||||
}
|
||||
|
||||
m_inTestFunction = false;
|
||||
}
|
||||
|
||||
void tst_EventLoop::fail()
|
||||
{
|
||||
QVERIFY2(!std::exchange(m_inTestFunction, true), "Earlier test failed to clean up");
|
||||
QFAIL("Failing test should still clean up");
|
||||
}
|
||||
|
||||
void tst_EventLoop::skip()
|
||||
{
|
||||
QVERIFY2(!std::exchange(m_inTestFunction, true), "Earlier test failed to clean up");
|
||||
QSKIP("Skipping test should still clean up");
|
||||
}
|
||||
|
||||
void tst_EventLoop::pass()
|
||||
{
|
||||
QVERIFY2(!std::exchange(m_inTestFunction, true), "Earlier test failed to clean up");
|
||||
{
|
||||
DeferredFlag flag;
|
||||
auto &loop = QTestEventLoop::instance();
|
||||
loop.enterLoopMSecs(100);
|
||||
QVERIFY(loop.timeout());
|
||||
QVERIFY(flag);
|
||||
}
|
||||
{
|
||||
DeferredFlag flag;
|
||||
QTRY_VERIFY(flag);
|
||||
}
|
||||
DeferredFlag flag;
|
||||
QTestEventLoop loop(this);
|
||||
QVERIFY(!flag);
|
||||
loop.enterLoopMSecs(1);
|
||||
QVERIFY(loop.timeout());
|
||||
QVERIFY(!flag);
|
||||
loop.enterLoopMSecs(100);
|
||||
QVERIFY(loop.timeout());
|
||||
QVERIFY(flag);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_EventLoop)
|
||||
#include "tst_eventloop.moc"
|
21
tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt
Normal file
21
tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## exceptionthrow Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_executable(exceptionthrow
|
||||
EXCEPTIONS
|
||||
NO_INSTALL
|
||||
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
tst_exceptionthrow.cpp
|
||||
LIBRARIES
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_apply_testlib_coverage_options(exceptionthrow)
|
@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
|
||||
#include <QTest>
|
||||
|
||||
class tst_Exception: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void throwException() const;
|
||||
};
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
We simply throw an exception to check that we get sane output/reporting.
|
||||
*/
|
||||
void tst_Exception::throwException() const
|
||||
{
|
||||
/* When exceptions are disabled, some compilers, at least linux-g++, treat
|
||||
* exception clauses as hard errors. */
|
||||
#ifndef QT_NO_EXCEPTIONS
|
||||
throw 3;
|
||||
#endif
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_Exception)
|
||||
|
||||
#include "tst_exceptionthrow.moc"
|
13
tests/auto/testlib/selftests/expected_assert.junitxml
Normal file
13
tests/auto/testlib/selftests/expected_assert.junitxml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_Assert" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="3" failures="0" errors="1" skipped="0" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_Assert" time="@TEST_DURATION@"/>
|
||||
<testcase name="testNumber1" classname="tst_Assert" time="@TEST_DURATION@"/>
|
||||
<testcase name="testNumber2" classname="tst_Assert" time="@TEST_DURATION@">
|
||||
<error type="qfatal" message="ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0"/>
|
||||
</testcase>
|
||||
</testsuite>
|
23
tests/auto/testlib/selftests/expected_assert.lightxml
Normal file
23
tests/auto/testlib/selftests/expected_assert.lightxml
Normal file
@ -0,0 +1,23 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="testNumber1">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="testNumber2">
|
||||
<Message type="qfatal" file="" line="0">
|
||||
<Description><![CDATA[ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp" line="0">
|
||||
<Description><![CDATA[Received a fatal error.]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
19
tests/auto/testlib/selftests/expected_assert.tap
Normal file
19
tests/auto/testlib/selftests/expected_assert.tap
Normal file
@ -0,0 +1,19 @@
|
||||
TAP version 13
|
||||
# tst_Assert
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - testNumber1()
|
||||
not ok 3 - testNumber2()
|
||||
---
|
||||
# Received a fatal error.
|
||||
at: tst_Assert::testNumber2() (qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp
|
||||
line: 0
|
||||
extensions:
|
||||
messages:
|
||||
- severity: fatal
|
||||
message: ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0
|
||||
...
|
||||
1..3
|
||||
# tests 3
|
||||
# pass 2
|
||||
# fail 1
|
10
tests/auto/testlib/selftests/expected_assert.teamcity
Normal file
10
tests/auto/testlib/selftests/expected_assert.teamcity
Normal file
@ -0,0 +1,10 @@
|
||||
##teamcity[testSuiteStarted name='tst_Assert' flowId='tst_Assert']
|
||||
##teamcity[testStarted name='initTestCase()' flowId='tst_Assert']
|
||||
##teamcity[testFinished name='initTestCase()' flowId='tst_Assert']
|
||||
##teamcity[testStarted name='testNumber1()' flowId='tst_Assert']
|
||||
##teamcity[testFinished name='testNumber1()' flowId='tst_Assert']
|
||||
##teamcity[testStarted name='testNumber2()' flowId='tst_Assert']
|
||||
##teamcity[testFailed name='testNumber2()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp(0)|]' details='Received a fatal error.' flowId='tst_Assert']
|
||||
##teamcity[testStdOut name='testNumber2()' out='QFATAL: ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0' flowId='tst_Assert']
|
||||
##teamcity[testFinished name='testNumber2()' flowId='tst_Assert']
|
||||
##teamcity[testSuiteFinished name='tst_Assert' flowId='tst_Assert']
|
9
tests/auto/testlib/selftests/expected_assert.txt
Normal file
9
tests/auto/testlib/selftests/expected_assert.txt
Normal file
@ -0,0 +1,9 @@
|
||||
********* Start testing of tst_Assert *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_Assert::initTestCase()
|
||||
PASS : tst_Assert::testNumber1()
|
||||
QFATAL : tst_Assert::testNumber2() ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0
|
||||
FAIL! : tst_Assert::testNumber2() Received a fatal error.
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp(0)]
|
||||
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_Assert *********
|
26
tests/auto/testlib/selftests/expected_assert.xml
Normal file
26
tests/auto/testlib/selftests/expected_assert.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_Assert">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="testNumber1">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="testNumber2">
|
||||
<Message type="qfatal" file="" line="0">
|
||||
<Description><![CDATA[ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp" line="0">
|
||||
<Description><![CDATA[Received a fatal error.]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
82
tests/auto/testlib/selftests/expected_badxml.junitxml
Normal file
82
tests/auto/testlib/selftests/expected_badxml.junitxml
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_BadXml" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="16" failures="5" errors="0" skipped="0" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_BadXml" time="@TEST_DURATION@"/>
|
||||
<testcase name="badDataTag(fail end cdata ]]> text ]]> more text)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="a failure"/>
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(pass end cdata ]]> text ]]> more text)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(fail quotes " text" more text)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="a failure"/>
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(pass quotes " text" more text)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(fail xml close > open < tags < text)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="a failure"/>
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(pass xml close > open < tags < text)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="a failure"/>
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badDataTag(pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[a message]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badMessage(string 0)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badMessage(string 1)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[quotes " text" more text]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badMessage(string 2)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[xml close > open < tags < text]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="badMessage(string 3)" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="failWithNoFile" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="failure message"/>
|
||||
</testcase>
|
||||
<testcase name="encoding" classname="tst_BadXml" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA["Ülrich Ümläut"]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="cleanupTestCase" classname="tst_BadXml" time="@TEST_DURATION@"/>
|
||||
</testsuite>
|
125
tests/auto/testlib/selftests/expected_badxml.lightxml
Normal file
125
tests/auto/testlib/selftests/expected_badxml.lightxml
Normal file
@ -0,0 +1,125 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="badDataTag">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass end cdata ]]> text ]]> more text" value="0" iterations="1" />
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass quotes " text" more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass quotes " text" more text]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass quotes " text" more text" value="0" iterations="1" />
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass xml close > open < tags < text" value="0" iterations="1" />
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="badMessage">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 0]]></DataTag>
|
||||
<Description><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 0]]></DataTag>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 1]]></DataTag>
|
||||
<Description><![CDATA[quotes " text" more text]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 1]]></DataTag>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 2]]></DataTag>
|
||||
<Description><![CDATA[xml close > open < tags < text]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 2]]></DataTag>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 3]]></DataTag>
|
||||
<Description><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 3]]></DataTag>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="failWithNoFile">
|
||||
<Incident type="fail" file="" line="0">
|
||||
<Description><![CDATA[failure message]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="encoding">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<Description><![CDATA["Ülrich Ümläut"]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
128
tests/auto/testlib/selftests/expected_badxml.xml
Normal file
128
tests/auto/testlib/selftests/expected_badxml.xml
Normal file
@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_BadXml">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="badDataTag">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass end cdata ]]> text ]]> more text" value="0" iterations="1" />
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass quotes " text" more text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass quotes " text" more text]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass quotes " text" more text" value="0" iterations="1" />
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass xml close > open < tags < text" value="0" iterations="1" />
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
|
||||
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
<Description><![CDATA[a failure]]></Description>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
<Description><![CDATA[a message]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="badMessage">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 0]]></DataTag>
|
||||
<Description><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 0]]></DataTag>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 1]]></DataTag>
|
||||
<Description><![CDATA[quotes " text" more text]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 1]]></DataTag>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 2]]></DataTag>
|
||||
<Description><![CDATA[xml close > open < tags < text]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 2]]></DataTag>
|
||||
</Incident>
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<DataTag><![CDATA[string 3]]></DataTag>
|
||||
<Description><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[string 3]]></DataTag>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="failWithNoFile">
|
||||
<Incident type="fail" file="" line="0">
|
||||
<Description><![CDATA[failure message]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="encoding">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<Description><![CDATA["Ülrich Ümläut"]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
@ -0,0 +1,10 @@
|
||||
********* Start testing of tst_BenchlibCallgrind *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibCallgrind::initTestCase()
|
||||
FAIL! : tst_BenchlibCallgrind::failInChildProcess() Running under valgrind!
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp(0)]
|
||||
SKIP : tst_BenchlibCallgrind::twoHundredMillionInstructions() This test is only defined for gcc and x86.
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp(0)]
|
||||
PASS : tst_BenchlibCallgrind::cleanupTestCase()
|
||||
Totals: 2 passed, 0 failed, 1 skipped, 0 blacklisted
|
||||
********* Finished testing of tst_BenchlibCallgrind *********
|
@ -0,0 +1,11 @@
|
||||
********* Start testing of tst_BenchlibCallgrind *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibCallgrind::initTestCase()
|
||||
FAIL! : tst_BenchlibCallgrind::failInChildProcess() Running under valgrind!
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp(0)]
|
||||
PASS : tst_BenchlibCallgrind::twoHundredMillionInstructions()
|
||||
RESULT : tst_BenchlibCallgrind::twoHundredMillionInstructions():
|
||||
200,000,144 instruction reads per iteration (total: 200,000,144, iterations: 1)
|
||||
PASS : tst_BenchlibCallgrind::cleanupTestCase()
|
||||
Totals: 3 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibCallgrind *********
|
@ -0,0 +1,5 @@
|
||||
********* Start testing of tst_BenchlibCallgrind *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibCallgrind::initTestCase()
|
||||
FAIL! : tst_BenchlibCallgrind::failInChildProcess() Running under valgrind!
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp(0)]
|
@ -0,0 +1 @@
|
||||
"passingBenchmark","","Events",0,0,1
|
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_BenchlibCounting" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="5" failures="1" errors="0" skipped="1" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_BenchlibCounting" time="@TEST_DURATION@"/>
|
||||
<testcase name="passingBenchmark" classname="tst_BenchlibCounting" time="@TEST_DURATION@"/>
|
||||
<testcase name="skippingBenchmark" classname="tst_BenchlibCounting" time="@TEST_DURATION@">
|
||||
<skipped message="This is a skipping benchmark"/>
|
||||
</testcase>
|
||||
<testcase name="failingBenchmark" classname="tst_BenchlibCounting" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="This is a failing benchmark"/>
|
||||
</testcase>
|
||||
<testcase name="cleanupTestCase" classname="tst_BenchlibCounting" time="@TEST_DURATION@"/>
|
||||
</testsuite>
|
@ -0,0 +1,31 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="passingBenchmark">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="Events" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="skippingBenchmark">
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
|
||||
<Description><![CDATA[This is a skipping benchmark]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="failingBenchmark">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
|
||||
<Description><![CDATA[This is a failing benchmark]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
17
tests/auto/testlib/selftests/expected_benchlibcounting.tap
Normal file
17
tests/auto/testlib/selftests/expected_benchlibcounting.tap
Normal file
@ -0,0 +1,17 @@
|
||||
TAP version 13
|
||||
# tst_BenchlibCounting
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - passingBenchmark()
|
||||
ok 3 - skippingBenchmark() # SKIP This is a skipping benchmark
|
||||
not ok 4 - failingBenchmark()
|
||||
---
|
||||
# This is a failing benchmark
|
||||
at: tst_BenchlibCounting::failingBenchmark() (qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 5 - cleanupTestCase()
|
||||
1..5
|
||||
# tests 5
|
||||
# pass 3
|
||||
# fail 1
|
13
tests/auto/testlib/selftests/expected_benchlibcounting.txt
Normal file
13
tests/auto/testlib/selftests/expected_benchlibcounting.txt
Normal file
@ -0,0 +1,13 @@
|
||||
********* Start testing of tst_BenchlibCounting *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibCounting::initTestCase()
|
||||
PASS : tst_BenchlibCounting::passingBenchmark()
|
||||
RESULT : tst_BenchlibCounting::passingBenchmark():
|
||||
0 events per iteration (total: 0, iterations: 1)
|
||||
SKIP : tst_BenchlibCounting::skippingBenchmark() This is a skipping benchmark
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(0)]
|
||||
FAIL! : tst_BenchlibCounting::failingBenchmark() This is a failing benchmark
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(0)]
|
||||
PASS : tst_BenchlibCounting::cleanupTestCase()
|
||||
Totals: 3 passed, 1 failed, 1 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibCounting *********
|
34
tests/auto/testlib/selftests/expected_benchlibcounting.xml
Normal file
34
tests/auto/testlib/selftests/expected_benchlibcounting.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_BenchlibCounting">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="passingBenchmark">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="Events" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="skippingBenchmark">
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
|
||||
<Description><![CDATA[This is a skipping benchmark]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="failingBenchmark">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
|
||||
<Description><![CDATA[This is a failing benchmark]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
@ -0,0 +1,7 @@
|
||||
"events","0","Events",0,0,1
|
||||
"events","1","Events",1,1,1
|
||||
"events","10","Events",10,10,1
|
||||
"events","100","Events",100,100,1
|
||||
"events","500","Events",500,500,1
|
||||
"events","5000","Events",5000,5000,1
|
||||
"events","100000","Events",100000,100000,1
|
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_BenchlibEventCounter" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="9" failures="0" errors="0" skipped="0" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(0)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(1)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(10)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(100)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(500)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(5000)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="events(100000)" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="cleanupTestCase" classname="tst_BenchlibEventCounter" time="@TEST_DURATION@"/>
|
||||
</testsuite>
|
@ -0,0 +1,45 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="events">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[0]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="0" value="0" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[1]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="1" value="1" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[10]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="10" value="10" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[100]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="100" value="100" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[500]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="500" value="500" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[5000]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="5000" value="5000" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[100000]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
@ -0,0 +1,15 @@
|
||||
TAP version 13
|
||||
# tst_BenchlibEventCounter
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - events(0)
|
||||
ok 3 - events(1)
|
||||
ok 4 - events(10)
|
||||
ok 5 - events(100)
|
||||
ok 6 - events(500)
|
||||
ok 7 - events(5000)
|
||||
ok 8 - events(100000)
|
||||
ok 9 - cleanupTestCase()
|
||||
1..9
|
||||
# tests 9
|
||||
# pass 9
|
||||
# fail 0
|
@ -0,0 +1,27 @@
|
||||
********* Start testing of tst_BenchlibEventCounter *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibEventCounter::initTestCase()
|
||||
PASS : tst_BenchlibEventCounter::events(0)
|
||||
RESULT : tst_BenchlibEventCounter::events():"0":
|
||||
0 events per iteration (total: 0, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::events(1)
|
||||
RESULT : tst_BenchlibEventCounter::events():"1":
|
||||
1 events per iteration (total: 1, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::events(10)
|
||||
RESULT : tst_BenchlibEventCounter::events():"10":
|
||||
10 events per iteration (total: 10, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::events(100)
|
||||
RESULT : tst_BenchlibEventCounter::events():"100":
|
||||
100 events per iteration (total: 100, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::events(500)
|
||||
RESULT : tst_BenchlibEventCounter::events():"500":
|
||||
500 events per iteration (total: 500, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::events(5000)
|
||||
RESULT : tst_BenchlibEventCounter::events():"5000":
|
||||
5,000 events per iteration (total: 5,000, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::events(100000)
|
||||
RESULT : tst_BenchlibEventCounter::events():"100000":
|
||||
100,000 events per iteration (total: 100,000, iterations: 1)
|
||||
PASS : tst_BenchlibEventCounter::cleanupTestCase()
|
||||
Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibEventCounter *********
|
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_BenchlibEventCounter">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="events">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[0]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="0" value="0" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[1]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="1" value="1" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[10]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="10" value="10" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[100]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="100" value="100" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[500]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="500" value="500" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[5000]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="5000" value="5000" iterations="1" />
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[100000]]></DataTag>
|
||||
</Incident>
|
||||
<BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
27
tests/auto/testlib/selftests/expected_benchliboptions.txt
Normal file
27
tests/auto/testlib/selftests/expected_benchliboptions.txt
Normal file
@ -0,0 +1,27 @@
|
||||
********* Start testing of tst_BenchlibOptions *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibOptions::initTestCase()
|
||||
PASS : tst_BenchlibOptions::threeEvents()
|
||||
RESULT : tst_BenchlibOptions::threeEvents():
|
||||
3 events per iteration (total: 3, iterations: 1)
|
||||
PASS : tst_BenchlibOptions::cleanupTestCase()
|
||||
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibOptions *********
|
||||
********* Start testing of tst_BenchlibFifteenIterations *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibFifteenIterations::initTestCase()
|
||||
PASS : tst_BenchlibFifteenIterations::threeEvents()
|
||||
RESULT : tst_BenchlibFifteenIterations::threeEvents():
|
||||
3.0 events per iteration (total: 45, iterations: 15)
|
||||
PASS : tst_BenchlibFifteenIterations::cleanupTestCase()
|
||||
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibFifteenIterations *********
|
||||
********* Start testing of tst_BenchlibOneHundredMinimum *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibOneHundredMinimum::initTestCase()
|
||||
PASS : tst_BenchlibOneHundredMinimum::threeEvents()
|
||||
RESULT : tst_BenchlibOneHundredMinimum::threeEvents():
|
||||
3.00 events per iteration (total: 192, iterations: 64)
|
||||
PASS : tst_BenchlibOneHundredMinimum::cleanupTestCase()
|
||||
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibOneHundredMinimum *********
|
@ -0,0 +1 @@
|
||||
"threeBillionTicks","","CPUTicks",3000012216,3000012216,1
|
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_BenchlibTickCounter" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="3" failures="0" errors="0" skipped="0" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_BenchlibTickCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="threeBillionTicks" classname="tst_BenchlibTickCounter" time="@TEST_DURATION@"/>
|
||||
<testcase name="cleanupTestCase" classname="tst_BenchlibTickCounter" time="@TEST_DURATION@"/>
|
||||
</testsuite>
|
@ -0,0 +1,19 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="threeBillionTicks">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="CPUTicks" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
@ -0,0 +1,9 @@
|
||||
TAP version 13
|
||||
# tst_BenchlibTickCounter
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - threeBillionTicks()
|
||||
ok 3 - cleanupTestCase()
|
||||
1..3
|
||||
# tests 3
|
||||
# pass 3
|
||||
# fail 0
|
@ -0,0 +1,9 @@
|
||||
********* Start testing of tst_BenchlibTickCounter *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibTickCounter::initTestCase()
|
||||
PASS : tst_BenchlibTickCounter::threeBillionTicks()
|
||||
RESULT : tst_BenchlibTickCounter::threeBillionTicks():
|
||||
0 CPU ticks per iteration (total: 0, iterations: 1)
|
||||
PASS : tst_BenchlibTickCounter::cleanupTestCase()
|
||||
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibTickCounter *********
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_BenchlibTickCounter">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="threeBillionTicks">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="CPUTicks" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
@ -0,0 +1,3 @@
|
||||
"waitForOneThousand","","WalltimeMilliseconds",1000,1000,1
|
||||
"waitForFourThousand","","WalltimeMilliseconds",4000,4000,1
|
||||
"qbenchmark_once","","WalltimeMilliseconds",0,0,1
|
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_BenchlibWalltime" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="5" failures="0" errors="0" skipped="0" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_BenchlibWalltime" time="@TEST_DURATION@"/>
|
||||
<testcase name="waitForOneThousand" classname="tst_BenchlibWalltime" time="@TEST_DURATION@"/>
|
||||
<testcase name="waitForFourThousand" classname="tst_BenchlibWalltime" time="@TEST_DURATION@"/>
|
||||
<testcase name="qbenchmark_once" classname="tst_BenchlibWalltime" time="@TEST_DURATION@"/>
|
||||
<testcase name="cleanupTestCase" classname="tst_BenchlibWalltime" time="@TEST_DURATION@"/>
|
||||
</testsuite>
|
@ -0,0 +1,29 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="waitForOneThousand">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="waitForFourThousand">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="qbenchmark_once">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
11
tests/auto/testlib/selftests/expected_benchlibwalltime.tap
Normal file
11
tests/auto/testlib/selftests/expected_benchlibwalltime.tap
Normal file
@ -0,0 +1,11 @@
|
||||
TAP version 13
|
||||
# tst_BenchlibWalltime
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - waitForOneThousand()
|
||||
ok 3 - waitForFourThousand()
|
||||
ok 4 - qbenchmark_once()
|
||||
ok 5 - cleanupTestCase()
|
||||
1..5
|
||||
# tests 5
|
||||
# pass 5
|
||||
# fail 0
|
15
tests/auto/testlib/selftests/expected_benchlibwalltime.txt
Normal file
15
tests/auto/testlib/selftests/expected_benchlibwalltime.txt
Normal file
@ -0,0 +1,15 @@
|
||||
********* Start testing of tst_BenchlibWalltime *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_BenchlibWalltime::initTestCase()
|
||||
PASS : tst_BenchlibWalltime::waitForOneThousand()
|
||||
RESULT : tst_BenchlibWalltime::waitForOneThousand():
|
||||
0 msecs per iteration (total: 0, iterations: 1)
|
||||
PASS : tst_BenchlibWalltime::waitForFourThousand()
|
||||
RESULT : tst_BenchlibWalltime::waitForFourThousand():
|
||||
0 msecs per iteration (total: 0, iterations: 1)
|
||||
PASS : tst_BenchlibWalltime::qbenchmark_once()
|
||||
RESULT : tst_BenchlibWalltime::qbenchmark_once():
|
||||
0 msecs per iteration (total: 0, iterations: 1)
|
||||
PASS : tst_BenchlibWalltime::cleanupTestCase()
|
||||
Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
|
||||
********* Finished testing of tst_BenchlibWalltime *********
|
32
tests/auto/testlib/selftests/expected_benchlibwalltime.xml
Normal file
32
tests/auto/testlib/selftests/expected_benchlibwalltime.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_BenchlibWalltime">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="waitForOneThousand">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="waitForFourThousand">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="qbenchmark_once">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
47
tests/auto/testlib/selftests/expected_blacklisted.junitxml
Normal file
47
tests/auto/testlib/selftests/expected_blacklisted.junitxml
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_Blacklisted" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="13" failures="0" errors="0" skipped="3" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="pass" classname="tst_Blacklisted" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[This test should BPASS]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="skip" classname="tst_Blacklisted" time="@TEST_DURATION@">
|
||||
<skipped message="This test should SKIP"/>
|
||||
</testcase>
|
||||
<testcase name="fail" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="xfail" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="multiSkip" classname="tst_Blacklisted" time="@TEST_DURATION@">
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="This skip should be repeated ten times"/>
|
||||
<skipped message="But this test should only contribute one to the skip count"/>
|
||||
</testcase>
|
||||
<testcase name="multiFail" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="xfailContinueSkip" classname="tst_Blacklisted" time="@TEST_DURATION@">
|
||||
<skipped message="This skip should be seen and counted"/>
|
||||
</testcase>
|
||||
<testcase name="xfailContinueFail" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="xpass" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="xpassContinueSkip" classname="tst_Blacklisted" time="@TEST_DURATION@">
|
||||
<skipped message="This skip should be seen but not counted"/>
|
||||
</testcase>
|
||||
<testcase name="xpassContinueFail" classname="tst_Blacklisted" time="@TEST_DURATION@"/>
|
||||
<testcase name="cleanupTestCase" classname="tst_Blacklisted" time="@TEST_DURATION@">
|
||||
<system-out>
|
||||
<![CDATA[Totals should add up to 13: 2 passed, 0 failed, 3 skipped, 8 blacklisted]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
</testsuite>
|
157
tests/auto/testlib/selftests/expected_blacklisted.lightxml
Normal file
157
tests/auto/testlib/selftests/expected_blacklisted.lightxml
Normal file
@ -0,0 +1,157 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="pass">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<Description><![CDATA[This test should BPASS]]></Description>
|
||||
</Message>
|
||||
<Incident type="bpass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="skip">
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should SKIP]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="fail">
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['false' returned FALSE. (This test should BFAIL)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xfail">
|
||||
<Incident type="bxfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should BXFAIL then BPASS]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bpass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="multiSkip">
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[But this test should only contribute one to the skip count]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="multiFail">
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[But this test should only contribute one to the blacklisted count]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xfailContinueSkip">
|
||||
<Incident type="bxfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should BXFAIL then SKIP]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be seen and counted]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xfailContinueFail">
|
||||
<Incident type="bxfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should BXFAIL then BFAIL]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This fail should be seen and counted as blacklisted]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xpass">
|
||||
<Incident type="bxpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should BXPASS)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xpassContinueSkip">
|
||||
<Incident type="bxpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should BXPASS then SKIP)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be seen but not counted]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xpassContinueFail">
|
||||
<Incident type="bxpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should BXPASS then BFAIL)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This fail should be seen and not counted (due to prior XPASS)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<Description><![CDATA[Totals should add up to 13: 2 passed, 0 failed, 3 skipped, 8 blacklisted]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
157
tests/auto/testlib/selftests/expected_blacklisted.tap
Normal file
157
tests/auto/testlib/selftests/expected_blacklisted.tap
Normal file
@ -0,0 +1,157 @@
|
||||
TAP version 13
|
||||
# tst_Blacklisted
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - pass() # TODO
|
||||
---
|
||||
extensions:
|
||||
messages:
|
||||
- severity: debug
|
||||
message: This test should BPASS
|
||||
...
|
||||
ok 3 - skip() # SKIP This test should SKIP
|
||||
not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL)
|
||||
---
|
||||
type: QVERIFY
|
||||
message: This test should BFAIL
|
||||
wanted: true (false)
|
||||
found: false (false)
|
||||
expected: true (false)
|
||||
actual: false (false)
|
||||
at: tst_Blacklisted::fail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 5 - xfail() # TODO This test should BXFAIL then BPASS
|
||||
---
|
||||
extensions:
|
||||
messages:
|
||||
- severity: xfail
|
||||
message: This test should BXFAIL then BPASS
|
||||
at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP This skip should be repeated ten times
|
||||
ok 6 - multiSkip() # SKIP But this test should only contribute one to the skip count
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO This failure message should be repeated ten times
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - multiFail() # TODO But this test should only contribute one to the blacklisted count
|
||||
---
|
||||
at: tst_Blacklisted::multiFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 8 - xfailContinueSkip() # SKIP This skip should be seen and counted
|
||||
---
|
||||
at: tst_Blacklisted::xfailContinueSkip() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
extensions:
|
||||
messages:
|
||||
- severity: xfail
|
||||
message: This test should BXFAIL then SKIP
|
||||
at: tst_Blacklisted::xfailContinueSkip() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 9 - xfailContinueFail() # TODO This fail should be seen and counted as blacklisted
|
||||
---
|
||||
at: tst_Blacklisted::xfailContinueFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
extensions:
|
||||
messages:
|
||||
- severity: xfail
|
||||
message: This test should BXFAIL then BFAIL
|
||||
at: tst_Blacklisted::xfailContinueFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 10 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS)
|
||||
ok 11 - xpassContinueSkip() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS then SKIP)
|
||||
ok 11 - xpassContinueSkip() # SKIP This skip should be seen but not counted
|
||||
ok 12 - xpassContinueFail() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS then BFAIL)
|
||||
not ok 12 - xpassContinueFail() # TODO This fail should be seen and not counted (due to prior XPASS)
|
||||
---
|
||||
at: tst_Blacklisted::xpassContinueFail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 13 - cleanupTestCase()
|
||||
---
|
||||
extensions:
|
||||
messages:
|
||||
- severity: debug
|
||||
message: Totals should add up to 13: 2 passed, 0 failed, 3 skipped, 8 blacklisted
|
||||
...
|
||||
1..13
|
||||
# tests 13
|
||||
# pass 2
|
||||
# fail 0
|
69
tests/auto/testlib/selftests/expected_blacklisted.teamcity
Normal file
69
tests/auto/testlib/selftests/expected_blacklisted.teamcity
Normal file
@ -0,0 +1,69 @@
|
||||
##teamcity[testSuiteStarted name='tst_Blacklisted' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='initTestCase()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='initTestCase()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='pass()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStdOut name='pass()' out='QDEBUG: This test should BPASS' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='pass()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='skip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='skip()' message='This test should SKIP |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='skip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='fail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='fail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='xfail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='This skip should be repeated ten times |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='multiSkip()' message='But this test should only contribute one to the skip count |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='multiFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='xfailContinueSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xfailContinueSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='xfailContinueSkip()' message='This skip should be seen and counted |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xfailContinueSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='xfailContinueFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xfailContinueFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xfailContinueFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='xpass()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xpass()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='xpassContinueSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xpassContinueSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testIgnored name='xpassContinueSkip()' message='This skip should be seen but not counted |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xpassContinueSkip()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='xpassContinueFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xpassContinueFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='xpassContinueFail()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Blacklisted']
|
||||
##teamcity[testStdOut name='cleanupTestCase()' out='QDEBUG: Totals should add up to 13: 2 passed, 0 failed, 3 skipped, 8 blacklisted' flowId='tst_Blacklisted']
|
||||
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Blacklisted']
|
||||
##teamcity[testSuiteFinished name='tst_Blacklisted' flowId='tst_Blacklisted']
|
78
tests/auto/testlib/selftests/expected_blacklisted.txt
Normal file
78
tests/auto/testlib/selftests/expected_blacklisted.txt
Normal file
@ -0,0 +1,78 @@
|
||||
********* Start testing of tst_Blacklisted *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_Blacklisted::initTestCase()
|
||||
QDEBUG : tst_Blacklisted::pass() This test should BPASS
|
||||
BPASS : tst_Blacklisted::pass()
|
||||
SKIP : tst_Blacklisted::skip() This test should SKIP
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::fail() 'false' returned FALSE. (This test should BFAIL)
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BXFAIL : tst_Blacklisted::xfail() This test should BXFAIL then BPASS
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BPASS : tst_Blacklisted::xfail()
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() This skip should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::multiSkip() But this test should only contribute one to the skip count
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() This failure message should be repeated ten times
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::multiFail() But this test should only contribute one to the blacklisted count
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BXFAIL : tst_Blacklisted::xfailContinueSkip() This test should BXFAIL then SKIP
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::xfailContinueSkip() This skip should be seen and counted
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BXFAIL : tst_Blacklisted::xfailContinueFail() This test should BXFAIL then BFAIL
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::xfailContinueFail() This fail should be seen and counted as blacklisted
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BXPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should BXPASS)
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BXPASS : tst_Blacklisted::xpassContinueSkip() 'true' returned TRUE unexpectedly. (This test should BXPASS then SKIP)
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
SKIP : tst_Blacklisted::xpassContinueSkip() This skip should be seen but not counted
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BXPASS : tst_Blacklisted::xpassContinueFail() 'true' returned TRUE unexpectedly. (This test should BXPASS then BFAIL)
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
BFAIL : tst_Blacklisted::xpassContinueFail() This fail should be seen and not counted (due to prior XPASS)
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
|
||||
QDEBUG : tst_Blacklisted::cleanupTestCase() Totals should add up to 13: 2 passed, 0 failed, 3 skipped, 8 blacklisted
|
||||
PASS : tst_Blacklisted::cleanupTestCase()
|
||||
Totals: 2 passed, 0 failed, 3 skipped, 8 blacklisted, 0ms
|
||||
********* Finished testing of tst_Blacklisted *********
|
160
tests/auto/testlib/selftests/expected_blacklisted.xml
Normal file
160
tests/auto/testlib/selftests/expected_blacklisted.xml
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestCase name="tst_Blacklisted">
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="pass">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<Description><![CDATA[This test should BPASS]]></Description>
|
||||
</Message>
|
||||
<Incident type="bpass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="skip">
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should SKIP]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="fail">
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['false' returned FALSE. (This test should BFAIL)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xfail">
|
||||
<Incident type="bxfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should BXFAIL then BPASS]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bpass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="multiSkip">
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[But this test should only contribute one to the skip count]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="multiFail">
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This failure message should be repeated ten times]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[But this test should only contribute one to the blacklisted count]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xfailContinueSkip">
|
||||
<Incident type="bxfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should BXFAIL then SKIP]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be seen and counted]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xfailContinueFail">
|
||||
<Incident type="bxfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This test should BXFAIL then BFAIL]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This fail should be seen and counted as blacklisted]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xpass">
|
||||
<Incident type="bxpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should BXPASS)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xpassContinueSkip">
|
||||
<Incident type="bxpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should BXPASS then SKIP)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This skip should be seen but not counted]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="xpassContinueFail">
|
||||
<Incident type="bxpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should BXPASS then BFAIL)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
|
||||
<Description><![CDATA[This fail should be seen and not counted (due to prior XPASS)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Message type="qdebug" file="" line="0">
|
||||
<Description><![CDATA[Totals should add up to 13: 2 passed, 0 failed, 3 skipped, 8 blacklisted]]></Description>
|
||||
</Message>
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
||||
</TestCase>
|
311
tests/auto/testlib/selftests/expected_cmptest.junitxml
Normal file
311
tests/auto/testlib/selftests/expected_cmptest.junitxml
Normal file
@ -0,0 +1,311 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite name="tst_Cmptest" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="70" failures="49" errors="0" skipped="0" time="@TEST_DURATION@">
|
||||
<properties>
|
||||
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
||||
<property name="QtBuild" value=""/>
|
||||
</properties>
|
||||
<testcase name="initTestCase" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compare_unregistered_enums" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (MyUnregisteredEnumValue1): 0
|
||||
Expected (MyUnregisteredEnumValue2): 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_registered_enums" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (Qt::Monday): Monday
|
||||
Expected (Qt::Sunday): Sunday]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_class_enums" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1
|
||||
Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="test_windowflags(pass)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="test_windowflags(fail1)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actualWindowFlags) : Window|WindowSystemMenuHint|WindowStaysOnBottomHint
|
||||
Expected (expectedWindowFlags): Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="test_windowflags(fail2)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actualWindowFlags) : Window
|
||||
Expected (expectedWindowFlags): Window|FramelessWindowHint]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="test_unregistered_flags(pass)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="test_unregistered_flags(fail1)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actualFlags) : 0x3
|
||||
Expected (expectedFlags): 0x5]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="test_unregistered_flags(fail2)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actualFlags) : 0x1
|
||||
Expected (expectedFlags): 0x5]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_boolfuncs" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compare_to_nullptr" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compare_pointerfuncs" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compare_tostring(int, string)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actual) : QVariant(int,123)
|
||||
Expected (expected): QVariant(QString,hi)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_tostring(both invalid)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compare_tostring(null hash, invalid)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actual) : QVariant(QVariantHash)
|
||||
Expected (expected): QVariant()]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_tostring(string, null user type)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actual) : QVariant(QString,A simple string)
|
||||
Expected (expected): QVariant(PhonyClass)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_tostring(both non-null user type)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
|
||||
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_unknown" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual : a
|
||||
Expected : b]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compare_textFromDebug" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (a): QDebug stream: 0
|
||||
Expected (b): QDebug stream: 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQObjects" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QObject pointers are not the same">
|
||||
<![CDATA[ Actual (&object1): QObject/"object1"
|
||||
Expected (&object2): QObject/"object2"]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQStringLists(empty lists)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQStringLists(equal lists)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQStringLists(last item different)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists differ at index 2.">
|
||||
<![CDATA[ Actual (opA): "string3"
|
||||
Expected (opB): "DIFFERS"]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQStringLists(second-last item different)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists differ at index 2.">
|
||||
<![CDATA[ Actual (opA): "string3"
|
||||
Expected (opB): "DIFFERS"]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQStringLists(prefix)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists have different sizes.">
|
||||
<![CDATA[ Actual (opA) size: 2
|
||||
Expected (opB) size: 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQStringLists(short list second)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists have different sizes.">
|
||||
<![CDATA[ Actual (opA) size: 12
|
||||
Expected (opB) size: 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQStringLists(short list first)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists have different sizes.">
|
||||
<![CDATA[ Actual (opA) size: 1
|
||||
Expected (opB) size: 12]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListInt(match)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQListInt(size mismatch)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists have different sizes.">
|
||||
<![CDATA[ Actual (actual) size: 2
|
||||
Expected (expected) size: 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListInt(value mismatch)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists differ at index 2.">
|
||||
<![CDATA[ Actual (actual): 4
|
||||
Expected (expected): 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListIntToArray(match)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQListIntToArray(size mismatch)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists have different sizes.">
|
||||
<![CDATA[ Actual (actual) size: 2
|
||||
Expected (expected) size: 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListIntToArray(value mismatch)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists differ at index 2.">
|
||||
<![CDATA[ Actual (actual): 4
|
||||
Expected (expected): 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListIntToInitializerList(match)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQListIntToInitializerList(size mismatch)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists have different sizes.">
|
||||
<![CDATA[ Actual (actual) size: 2
|
||||
Expected (ARG({1, 2, 3})) size: 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListIntToInitializerList(value mismatch)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists differ at index 2.">
|
||||
<![CDATA[ Actual (actual): 4
|
||||
Expected (ARG({1, 2, 3})): 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQListDouble" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared lists differ at index 0.">
|
||||
<![CDATA[ Actual (double1): 1.5
|
||||
Expected (double2): 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQColor(Qt::yellow vs "yellow")" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQColor(Qt::yellow vs Qt::green)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (colorA): #ffffff00
|
||||
Expected (colorB): #ff00ff00]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQColor(0x88ff0000 vs 0xffff0000)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (colorA): #88ff0000
|
||||
Expected (colorB): #ffff0000]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQPixmaps(both null)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQPixmaps(one null)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QPixmaps differ.">
|
||||
<![CDATA[ Actual (opA).isNull(): 1
|
||||
Expected (opB).isNull(): 0]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQPixmaps(other null)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QPixmaps differ.">
|
||||
<![CDATA[ Actual (opA).isNull(): 0
|
||||
Expected (opB).isNull(): 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQPixmaps(equal)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQPixmaps(different size)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QPixmaps differ in size.">
|
||||
<![CDATA[ Actual (opA): 11x20
|
||||
Expected (opB): 20x20]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQPixmaps(different pixels)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same"/>
|
||||
</testcase>
|
||||
<testcase name="compareQPixmaps(different dpr)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QPixmaps differ in device pixel ratio.">
|
||||
<![CDATA[ Actual (opA): 1
|
||||
Expected (opB): 2]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQImages(both null)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQImages(one null)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QImages differ.">
|
||||
<![CDATA[ Actual (opA).isNull(): 1
|
||||
Expected (opB).isNull(): 0]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQImages(other null)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QImages differ.">
|
||||
<![CDATA[ Actual (opA).isNull(): 0
|
||||
Expected (opB).isNull(): 1]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQImages(equal)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQImages(different size)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QImages differ in size.">
|
||||
<![CDATA[ Actual (opA): 11x20
|
||||
Expected (opB): 20x20]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQImages(different format)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QImages differ in format.">
|
||||
<![CDATA[ Actual (opA): 6
|
||||
Expected (opB): 3]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQImages(different pixels)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same"/>
|
||||
</testcase>
|
||||
<testcase name="compareQImages(different dpr)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared QImages differ in device pixel ratio.">
|
||||
<![CDATA[ Actual (opA): 1
|
||||
Expected (opB): 2]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQRegion(equal-empty)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQRegion(1-empty)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (rA): QRegion(200x50+10+10)
|
||||
Expected (rB): QRegion(null)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQRegion(equal)" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="compareQRegion(different lists)" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (rA): QRegion(200x50+10+10)
|
||||
Expected (rB): QRegion(2 rectangles, 50x200+100+200, 200x50+10+10)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQVector2D" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (v2a): QVector2D(1, 2)
|
||||
Expected (v2b): QVector2D(1, 3)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQVector3D" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (v3a): QVector3D(1, 2, 3)
|
||||
Expected (v3b): QVector3D(1, 3, 3)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="compareQVector4D" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (v4a): QVector4D(1, 2, 3, 4)
|
||||
Expected (v4b): QVector4D(1, 3, 3, 4)]]>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase name="tryCompare" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="Compared values are not the same">
|
||||
<![CDATA[ Actual (c) : DeferredFlag(true)
|
||||
Expected (DeferredFlag()): DeferredFlag(false)]]>
|
||||
</failure>
|
||||
<system-out>
|
||||
<![CDATA[Should now time out and fail]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="verify" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="'opaqueFunc() < 2' returned FALSE. ()"/>
|
||||
</testcase>
|
||||
<testcase name="verify2" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="'opaqueFunc() < 2' returned FALSE. (42 >= 2 (as expected, in fact))"/>
|
||||
</testcase>
|
||||
<testcase name="tryVerify" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="'!c' returned FALSE. ()"/>
|
||||
<system-out>
|
||||
<![CDATA[Should now time out and fail]]>
|
||||
</system-out>
|
||||
</testcase>
|
||||
<testcase name="tryVerify2" classname="tst_Cmptest" time="@TEST_DURATION@">
|
||||
<failure type="fail" message="'!c' returned FALSE. (Should time out and fail)"/>
|
||||
</testcase>
|
||||
<testcase name="verifyExplicitOperatorBool" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
<testcase name="cleanupTestCase" classname="tst_Cmptest" time="@TEST_DURATION@"/>
|
||||
</testsuite>
|
426
tests/auto/testlib/selftests/expected_cmptest.lightxml
Normal file
426
tests/auto/testlib/selftests/expected_cmptest.lightxml
Normal file
@ -0,0 +1,426 @@
|
||||
<Environment>
|
||||
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
|
||||
<QtBuild/>
|
||||
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
|
||||
</Environment>
|
||||
<TestFunction name="initTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_unregistered_enums">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (MyUnregisteredEnumValue1): 0
|
||||
Expected (MyUnregisteredEnumValue2): 1]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_registered_enums">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (Qt::Monday): Monday
|
||||
Expected (Qt::Sunday): Sunday]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_class_enums">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1
|
||||
Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="test_windowflags">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[fail1]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actualWindowFlags) : Window|WindowSystemMenuHint|WindowStaysOnBottomHint
|
||||
Expected (expectedWindowFlags): Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[fail2]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actualWindowFlags) : Window
|
||||
Expected (expectedWindowFlags): Window|FramelessWindowHint]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="test_unregistered_flags">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[pass]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[fail1]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actualFlags) : 0x3
|
||||
Expected (expectedFlags): 0x5]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[fail2]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actualFlags) : 0x1
|
||||
Expected (expectedFlags): 0x5]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_boolfuncs">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_to_nullptr">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_pointerfuncs">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_tostring">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[int, string]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actual) : QVariant(int,123)
|
||||
Expected (expected): QVariant(QString,hi)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[both invalid]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[null hash, invalid]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actual) : QVariant(QVariantHash)
|
||||
Expected (expected): QVariant()]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[string, null user type]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actual) : QVariant(QString,A simple string)
|
||||
Expected (expected): QVariant(PhonyClass)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[both non-null user type]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
|
||||
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_unknown">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual : a
|
||||
Expected : b]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compare_textFromDebug">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (a): QDebug stream: 0
|
||||
Expected (b): QDebug stream: 1]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQObjects">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared QObject pointers are not the same
|
||||
Actual (&object1): QObject/"object1"
|
||||
Expected (&object2): QObject/"object2"]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQStringLists">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[empty lists]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[equal lists]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[last item different]]></DataTag>
|
||||
<Description><![CDATA[Compared lists differ at index 2.
|
||||
Actual (opA): "string3"
|
||||
Expected (opB): "DIFFERS"]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[second-last item different]]></DataTag>
|
||||
<Description><![CDATA[Compared lists differ at index 2.
|
||||
Actual (opA): "string3"
|
||||
Expected (opB): "DIFFERS"]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[prefix]]></DataTag>
|
||||
<Description><![CDATA[Compared lists have different sizes.
|
||||
Actual (opA) size: 2
|
||||
Expected (opB) size: 1]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[short list second]]></DataTag>
|
||||
<Description><![CDATA[Compared lists have different sizes.
|
||||
Actual (opA) size: 12
|
||||
Expected (opB) size: 1]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[short list first]]></DataTag>
|
||||
<Description><![CDATA[Compared lists have different sizes.
|
||||
Actual (opA) size: 1
|
||||
Expected (opB) size: 12]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQListInt">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[match]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[size mismatch]]></DataTag>
|
||||
<Description><![CDATA[Compared lists have different sizes.
|
||||
Actual (actual) size: 2
|
||||
Expected (expected) size: 3]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[value mismatch]]></DataTag>
|
||||
<Description><![CDATA[Compared lists differ at index 2.
|
||||
Actual (actual): 4
|
||||
Expected (expected): 3]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQListIntToArray">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[match]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[size mismatch]]></DataTag>
|
||||
<Description><![CDATA[Compared lists have different sizes.
|
||||
Actual (actual) size: 2
|
||||
Expected (expected) size: 3]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[value mismatch]]></DataTag>
|
||||
<Description><![CDATA[Compared lists differ at index 2.
|
||||
Actual (actual): 4
|
||||
Expected (expected): 3]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQListIntToInitializerList">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[match]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[size mismatch]]></DataTag>
|
||||
<Description><![CDATA[Compared lists have different sizes.
|
||||
Actual (actual) size: 2
|
||||
Expected (ARG({1, 2, 3})) size: 3]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[value mismatch]]></DataTag>
|
||||
<Description><![CDATA[Compared lists differ at index 2.
|
||||
Actual (actual): 4
|
||||
Expected (ARG({1, 2, 3})): 3]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQListDouble">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared lists differ at index 0.
|
||||
Actual (double1): 1.5
|
||||
Expected (double2): 1]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQColor">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[Qt::yellow vs "yellow"]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[Qt::yellow vs Qt::green]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (colorA): #ffffff00
|
||||
Expected (colorB): #ff00ff00]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[0x88ff0000 vs 0xffff0000]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (colorA): #88ff0000
|
||||
Expected (colorB): #ffff0000]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQPixmaps">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[both null]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[one null]]></DataTag>
|
||||
<Description><![CDATA[Compared QPixmaps differ.
|
||||
Actual (opA).isNull(): 1
|
||||
Expected (opB).isNull(): 0]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[other null]]></DataTag>
|
||||
<Description><![CDATA[Compared QPixmaps differ.
|
||||
Actual (opA).isNull(): 0
|
||||
Expected (opB).isNull(): 1]]></Description>
|
||||
</Incident>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[equal]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different size]]></DataTag>
|
||||
<Description><![CDATA[Compared QPixmaps differ in size.
|
||||
Actual (opA): 11x20
|
||||
Expected (opB): 20x20]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different pixels]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different dpr]]></DataTag>
|
||||
<Description><![CDATA[Compared QPixmaps differ in device pixel ratio.
|
||||
Actual (opA): 1
|
||||
Expected (opB): 2]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQImages">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[both null]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[one null]]></DataTag>
|
||||
<Description><![CDATA[Compared QImages differ.
|
||||
Actual (opA).isNull(): 1
|
||||
Expected (opB).isNull(): 0]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[other null]]></DataTag>
|
||||
<Description><![CDATA[Compared QImages differ.
|
||||
Actual (opA).isNull(): 0
|
||||
Expected (opB).isNull(): 1]]></Description>
|
||||
</Incident>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[equal]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different size]]></DataTag>
|
||||
<Description><![CDATA[Compared QImages differ in size.
|
||||
Actual (opA): 11x20
|
||||
Expected (opB): 20x20]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different format]]></DataTag>
|
||||
<Description><![CDATA[Compared QImages differ in format.
|
||||
Actual (opA): 6
|
||||
Expected (opB): 3]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different pixels]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same]]></Description>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different dpr]]></DataTag>
|
||||
<Description><![CDATA[Compared QImages differ in device pixel ratio.
|
||||
Actual (opA): 1
|
||||
Expected (opB): 2]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQRegion">
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[equal-empty]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[1-empty]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (rA): QRegion(200x50+10+10)
|
||||
Expected (rB): QRegion(null)]]></Description>
|
||||
</Incident>
|
||||
<Incident type="pass" file="" line="0">
|
||||
<DataTag><![CDATA[equal]]></DataTag>
|
||||
</Incident>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<DataTag><![CDATA[different lists]]></DataTag>
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (rA): QRegion(200x50+10+10)
|
||||
Expected (rB): QRegion(2 rectangles, 50x200+100+200, 200x50+10+10)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQVector2D">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (v2a): QVector2D(1, 2)
|
||||
Expected (v2b): QVector2D(1, 3)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQVector3D">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (v3a): QVector3D(1, 2, 3)
|
||||
Expected (v3b): QVector3D(1, 3, 3)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="compareQVector4D">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (v4a): QVector4D(1, 2, 3, 4)
|
||||
Expected (v4b): QVector4D(1, 3, 3, 4)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="tryCompare">
|
||||
<Message type="qinfo" file="" line="0">
|
||||
<Description><![CDATA[Should now time out and fail]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA[Compared values are not the same
|
||||
Actual (c) : DeferredFlag(true)
|
||||
Expected (DeferredFlag()): DeferredFlag(false)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="verify">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="verify2">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42 >= 2 (as expected, in fact))]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="tryVerify">
|
||||
<Message type="qinfo" file="" line="0">
|
||||
<Description><![CDATA[Should now time out and fail]]></Description>
|
||||
</Message>
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA['!c' returned FALSE. ()]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="tryVerify2">
|
||||
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
|
||||
<Description><![CDATA['!c' returned FALSE. (Should time out and fail)]]></Description>
|
||||
</Incident>
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="verifyExplicitOperatorBool">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<TestFunction name="cleanupTestCase">
|
||||
<Incident type="pass" file="" line="0" />
|
||||
<Duration msecs="0"/>
|
||||
</TestFunction>
|
||||
<Duration msecs="0"/>
|
592
tests/auto/testlib/selftests/expected_cmptest.tap
Normal file
592
tests/auto/testlib/selftests/expected_cmptest.tap
Normal file
@ -0,0 +1,592 @@
|
||||
TAP version 13
|
||||
# tst_Cmptest
|
||||
ok 1 - initTestCase()
|
||||
not ok 2 - compare_unregistered_enums()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: 1 (MyUnregisteredEnumValue2)
|
||||
found: 0 (MyUnregisteredEnumValue1)
|
||||
expected: 1 (MyUnregisteredEnumValue2)
|
||||
actual: 0 (MyUnregisteredEnumValue1)
|
||||
at: tst_Cmptest::compare_unregistered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 3 - compare_registered_enums()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: Sunday (Qt::Sunday)
|
||||
found: Monday (Qt::Monday)
|
||||
expected: Sunday (Qt::Sunday)
|
||||
actual: Monday (Qt::Monday)
|
||||
at: tst_Cmptest::compare_registered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 4 - compare_class_enums()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: MyClassEnumValue2 (MyClassEnum::MyClassEnumValue2)
|
||||
found: MyClassEnumValue1 (MyClassEnum::MyClassEnumValue1)
|
||||
expected: MyClassEnumValue2 (MyClassEnum::MyClassEnumValue2)
|
||||
actual: MyClassEnumValue1 (MyClassEnum::MyClassEnumValue1)
|
||||
at: tst_Cmptest::compare_class_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 5 - test_windowflags(pass)
|
||||
not ok 6 - test_windowflags(fail1)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint (expectedWindowFlags)
|
||||
found: Window|WindowSystemMenuHint|WindowStaysOnBottomHint (actualWindowFlags)
|
||||
expected: Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint (expectedWindowFlags)
|
||||
actual: Window|WindowSystemMenuHint|WindowStaysOnBottomHint (actualWindowFlags)
|
||||
at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 7 - test_windowflags(fail2)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: Window|FramelessWindowHint (expectedWindowFlags)
|
||||
found: Window (actualWindowFlags)
|
||||
expected: Window|FramelessWindowHint (expectedWindowFlags)
|
||||
actual: Window (actualWindowFlags)
|
||||
at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 8 - test_unregistered_flags(pass)
|
||||
not ok 9 - test_unregistered_flags(fail1)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: 0x5 (expectedFlags)
|
||||
found: 0x3 (actualFlags)
|
||||
expected: 0x5 (expectedFlags)
|
||||
actual: 0x3 (actualFlags)
|
||||
at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 10 - test_unregistered_flags(fail2)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: 0x5 (expectedFlags)
|
||||
found: 0x1 (actualFlags)
|
||||
expected: 0x5 (expectedFlags)
|
||||
actual: 0x1 (actualFlags)
|
||||
at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 11 - compare_boolfuncs()
|
||||
ok 12 - compare_to_nullptr()
|
||||
ok 13 - compare_pointerfuncs()
|
||||
not ok 14 - compare_tostring(int, string)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVariant(QString,hi) (expected)
|
||||
found: QVariant(int,123) (actual)
|
||||
expected: QVariant(QString,hi) (expected)
|
||||
actual: QVariant(int,123) (actual)
|
||||
at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 15 - compare_tostring(both invalid)
|
||||
not ok 16 - compare_tostring(null hash, invalid)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVariant() (expected)
|
||||
found: QVariant(QVariantHash) (actual)
|
||||
expected: QVariant() (expected)
|
||||
actual: QVariant(QVariantHash) (actual)
|
||||
at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 17 - compare_tostring(string, null user type)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVariant(PhonyClass) (expected)
|
||||
found: QVariant(QString,A simple string) (actual)
|
||||
expected: QVariant(PhonyClass) (expected)
|
||||
actual: QVariant(QString,A simple string) (actual)
|
||||
at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 18 - compare_tostring(both non-null user type)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVariant(PhonyClass,<value not representable as string>) (expected)
|
||||
found: QVariant(PhonyClass,<value not representable as string>) (actual)
|
||||
expected: QVariant(PhonyClass,<value not representable as string>) (expected)
|
||||
actual: QVariant(PhonyClass,<value not representable as string>) (actual)
|
||||
at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 19 - compare_unknown()
|
||||
---
|
||||
# Compared values are not the same
|
||||
Actual : a
|
||||
Expected : b
|
||||
at: tst_Cmptest::compare_unknown() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 20 - compare_textFromDebug()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QDebug stream: 1 (b)
|
||||
found: QDebug stream: 0 (a)
|
||||
expected: QDebug stream: 1 (b)
|
||||
actual: QDebug stream: 0 (a)
|
||||
at: tst_Cmptest::compare_textFromDebug() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 21 - compareQObjects()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QObject pointers are not the same
|
||||
wanted: QObject/"object2" (&object2)
|
||||
found: QObject/"object1" (&object1)
|
||||
expected: QObject/"object2" (&object2)
|
||||
actual: QObject/"object1" (&object1)
|
||||
at: tst_Cmptest::compareQObjects() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 22 - compareQStringLists(empty lists)
|
||||
ok 23 - compareQStringLists(equal lists)
|
||||
not ok 24 - compareQStringLists(last item different)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared lists differ at index 2.
|
||||
wanted: "DIFFERS" (opB)
|
||||
found: "string3" (opA)
|
||||
expected: "DIFFERS" (opB)
|
||||
actual: "string3" (opA)
|
||||
at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 25 - compareQStringLists(second-last item different)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared lists differ at index 2.
|
||||
wanted: "DIFFERS" (opB)
|
||||
found: "string3" (opA)
|
||||
expected: "DIFFERS" (opB)
|
||||
actual: "string3" (opA)
|
||||
at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 26 - compareQStringLists(prefix)
|
||||
---
|
||||
# Compared lists have different sizes.
|
||||
Actual (opA) size: 2
|
||||
Expected (opB) size: 1
|
||||
at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 27 - compareQStringLists(short list second)
|
||||
---
|
||||
# Compared lists have different sizes.
|
||||
Actual (opA) size: 12
|
||||
Expected (opB) size: 1
|
||||
at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 28 - compareQStringLists(short list first)
|
||||
---
|
||||
# Compared lists have different sizes.
|
||||
Actual (opA) size: 1
|
||||
Expected (opB) size: 12
|
||||
at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 29 - compareQListInt(match)
|
||||
not ok 30 - compareQListInt(size mismatch)
|
||||
---
|
||||
# Compared lists have different sizes.
|
||||
Actual (actual) size: 2
|
||||
Expected (expected) size: 3
|
||||
at: tst_Cmptest::compareQListInt() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 31 - compareQListInt(value mismatch)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared lists differ at index 2.
|
||||
wanted: 3 (expected)
|
||||
found: 4 (actual)
|
||||
expected: 3 (expected)
|
||||
actual: 4 (actual)
|
||||
at: tst_Cmptest::compareQListInt() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 32 - compareQListIntToArray(match)
|
||||
not ok 33 - compareQListIntToArray(size mismatch)
|
||||
---
|
||||
# Compared lists have different sizes.
|
||||
Actual (actual) size: 2
|
||||
Expected (expected) size: 3
|
||||
at: tst_Cmptest::compareQListIntToArray() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 34 - compareQListIntToArray(value mismatch)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared lists differ at index 2.
|
||||
wanted: 3 (expected)
|
||||
found: 4 (actual)
|
||||
expected: 3 (expected)
|
||||
actual: 4 (actual)
|
||||
at: tst_Cmptest::compareQListIntToArray() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 35 - compareQListIntToInitializerList(match)
|
||||
not ok 36 - compareQListIntToInitializerList(size mismatch)
|
||||
---
|
||||
# Compared lists have different sizes.
|
||||
Actual (actual) size: 2
|
||||
Expected (ARG({1, 2, 3})) size: 3
|
||||
at: tst_Cmptest::compareQListIntToInitializerList() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 37 - compareQListIntToInitializerList(value mismatch)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared lists differ at index 2.
|
||||
wanted: 3 (ARG({1, 2, 3}))
|
||||
found: 4 (actual)
|
||||
expected: 3 (ARG({1, 2, 3}))
|
||||
actual: 4 (actual)
|
||||
at: tst_Cmptest::compareQListIntToInitializerList() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 38 - compareQListDouble()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared lists differ at index 0.
|
||||
wanted: 1 (double2)
|
||||
found: 1.5 (double1)
|
||||
expected: 1 (double2)
|
||||
actual: 1.5 (double1)
|
||||
at: tst_Cmptest::compareQListDouble() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 39 - compareQColor(Qt::yellow vs "yellow")
|
||||
not ok 40 - compareQColor(Qt::yellow vs Qt::green)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: #ff00ff00 (colorB)
|
||||
found: #ffffff00 (colorA)
|
||||
expected: #ff00ff00 (colorB)
|
||||
actual: #ffffff00 (colorA)
|
||||
at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 41 - compareQColor(0x88ff0000 vs 0xffff0000)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: #ffff0000 (colorB)
|
||||
found: #88ff0000 (colorA)
|
||||
expected: #ffff0000 (colorB)
|
||||
actual: #88ff0000 (colorA)
|
||||
at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 42 - compareQPixmaps(both null)
|
||||
not ok 43 - compareQPixmaps(one null)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QPixmaps differ.
|
||||
wanted: 0 (opB).isNull()
|
||||
found: 1 (opA).isNull()
|
||||
expected: 0 (opB).isNull()
|
||||
actual: 1 (opA).isNull()
|
||||
at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 44 - compareQPixmaps(other null)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QPixmaps differ.
|
||||
wanted: 1 (opB).isNull()
|
||||
found: 0 (opA).isNull()
|
||||
expected: 1 (opB).isNull()
|
||||
actual: 0 (opA).isNull()
|
||||
at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 45 - compareQPixmaps(equal)
|
||||
not ok 46 - compareQPixmaps(different size)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QPixmaps differ in size.
|
||||
wanted: 20x20 (opB)
|
||||
found: 11x20 (opA)
|
||||
expected: 20x20 (opB)
|
||||
actual: 11x20 (opA)
|
||||
at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 47 - compareQPixmaps(different pixels)
|
||||
---
|
||||
# Compared values are not the same
|
||||
at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 48 - compareQPixmaps(different dpr)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QPixmaps differ in device pixel ratio.
|
||||
wanted: 2 (opB)
|
||||
found: 1 (opA)
|
||||
expected: 2 (opB)
|
||||
actual: 1 (opA)
|
||||
at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 49 - compareQImages(both null)
|
||||
not ok 50 - compareQImages(one null)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QImages differ.
|
||||
wanted: 0 (opB).isNull()
|
||||
found: 1 (opA).isNull()
|
||||
expected: 0 (opB).isNull()
|
||||
actual: 1 (opA).isNull()
|
||||
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 51 - compareQImages(other null)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QImages differ.
|
||||
wanted: 1 (opB).isNull()
|
||||
found: 0 (opA).isNull()
|
||||
expected: 1 (opB).isNull()
|
||||
actual: 0 (opA).isNull()
|
||||
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 52 - compareQImages(equal)
|
||||
not ok 53 - compareQImages(different size)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QImages differ in size.
|
||||
wanted: 20x20 (opB)
|
||||
found: 11x20 (opA)
|
||||
expected: 20x20 (opB)
|
||||
actual: 11x20 (opA)
|
||||
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 54 - compareQImages(different format)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QImages differ in format.
|
||||
wanted: 3 (opB)
|
||||
found: 6 (opA)
|
||||
expected: 3 (opB)
|
||||
actual: 6 (opA)
|
||||
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 55 - compareQImages(different pixels)
|
||||
---
|
||||
# Compared values are not the same
|
||||
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 56 - compareQImages(different dpr)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared QImages differ in device pixel ratio.
|
||||
wanted: 2 (opB)
|
||||
found: 1 (opA)
|
||||
expected: 2 (opB)
|
||||
actual: 1 (opA)
|
||||
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 57 - compareQRegion(equal-empty)
|
||||
not ok 58 - compareQRegion(1-empty)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QRegion(null) (rB)
|
||||
found: QRegion(200x50+10+10) (rA)
|
||||
expected: QRegion(null) (rB)
|
||||
actual: QRegion(200x50+10+10) (rA)
|
||||
at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 59 - compareQRegion(equal)
|
||||
not ok 60 - compareQRegion(different lists)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB)
|
||||
found: QRegion(200x50+10+10) (rA)
|
||||
expected: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB)
|
||||
actual: QRegion(200x50+10+10) (rA)
|
||||
at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 61 - compareQVector2D()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVector2D(1, 3) (v2b)
|
||||
found: QVector2D(1, 2) (v2a)
|
||||
expected: QVector2D(1, 3) (v2b)
|
||||
actual: QVector2D(1, 2) (v2a)
|
||||
at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 62 - compareQVector3D()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVector3D(1, 3, 3) (v3b)
|
||||
found: QVector3D(1, 2, 3) (v3a)
|
||||
expected: QVector3D(1, 3, 3) (v3b)
|
||||
actual: QVector3D(1, 2, 3) (v3a)
|
||||
at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 63 - compareQVector4D()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: QVector4D(1, 3, 3, 4) (v4b)
|
||||
found: QVector4D(1, 2, 3, 4) (v4a)
|
||||
expected: QVector4D(1, 3, 3, 4) (v4b)
|
||||
actual: QVector4D(1, 2, 3, 4) (v4a)
|
||||
at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 64 - tryCompare()
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared values are not the same
|
||||
wanted: DeferredFlag(false) (DeferredFlag())
|
||||
found: DeferredFlag(true) (c)
|
||||
expected: DeferredFlag(false) (DeferredFlag())
|
||||
actual: DeferredFlag(true) (c)
|
||||
at: tst_Cmptest::tryCompare() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
extensions:
|
||||
messages:
|
||||
- severity: info
|
||||
message: Should now time out and fail
|
||||
...
|
||||
not ok 65 - verify()
|
||||
---
|
||||
type: QVERIFY
|
||||
message: Verification failed
|
||||
wanted: true (opaqueFunc() < 2)
|
||||
found: false (opaqueFunc() < 2)
|
||||
expected: true (opaqueFunc() < 2)
|
||||
actual: false (opaqueFunc() < 2)
|
||||
at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 66 - verify2()
|
||||
---
|
||||
type: QVERIFY
|
||||
message: 42 >= 2 (as expected, in fact)
|
||||
wanted: true (opaqueFunc() < 2)
|
||||
found: false (opaqueFunc() < 2)
|
||||
expected: true (opaqueFunc() < 2)
|
||||
actual: false (opaqueFunc() < 2)
|
||||
at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
not ok 67 - tryVerify()
|
||||
---
|
||||
type: QVERIFY
|
||||
message: Verification failed
|
||||
wanted: true (!c)
|
||||
found: false (!c)
|
||||
expected: true (!c)
|
||||
actual: false (!c)
|
||||
at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
extensions:
|
||||
messages:
|
||||
- severity: info
|
||||
message: Should now time out and fail
|
||||
...
|
||||
not ok 68 - tryVerify2()
|
||||
---
|
||||
type: QVERIFY
|
||||
message: Should time out and fail
|
||||
wanted: true (!c)
|
||||
found: false (!c)
|
||||
expected: true (!c)
|
||||
actual: false (!c)
|
||||
at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
|
||||
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
|
||||
line: 0
|
||||
...
|
||||
ok 69 - verifyExplicitOperatorBool()
|
||||
ok 70 - cleanupTestCase()
|
||||
1..70
|
||||
# tests 70
|
||||
# pass 21
|
||||
# fail 49
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user