QXmlStream: run the test suite from a method other than initTestCase()

Only unzip the test suite in initTestCase(), but run the tests from
runTestSuite(). This is mainly useful when running specific a unittest
locally, no need to wait for the whole zipped test suite to run.

Change-Id: I518a2de716d3d07fb5a78298f1bd3ab2759e744b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2023-04-01 23:18:57 +02:00
parent d1140235e2
commit 3202ab1eb1

View File

@ -542,6 +542,7 @@ public:
private slots:
void initTestCase();
void cleanupTestCase();
void runTestSuite();
void reportFailures() const;
void reportFailures_data();
void checkBaseline() const;
@ -624,7 +625,14 @@ void tst_QXmlStream::initTestCase()
QFile::remove(destinationPath); // copy will fail if file exists
QVERIFY(QFile::copy(fileInfo.filePath(), destinationPath));
}
}
void tst_QXmlStream::cleanupTestCase()
{
}
void tst_QXmlStream::runTestSuite()
{
QFile file(m_tempDir.filePath(catalogFile));
QVERIFY2(file.open(QIODevice::ReadOnly),
qPrintable(QString::fromLatin1("Failed to open the test suite catalog; %1").arg(file.fileName())));
@ -632,10 +640,6 @@ void tst_QXmlStream::initTestCase()
QVERIFY(m_handler.runTests(&file));
}
void tst_QXmlStream::cleanupTestCase()
{
}
void tst_QXmlStream::reportFailures() const
{
QFETCH(bool, isError);