tst_linebylinelex: Hotfix: skip test if no test data is found

The test looks in the wrong place for the test data. As a hot-fix, skip
the test if no test-data is found to avoid a subsequent assert.

Task-number: QTBUG-105697
Change-Id: Ib7a38faec123662fb1ea9fad8d0da60ede074486
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fabian Kosmale 2022-09-13 08:38:53 +02:00
parent ff5b714fdc
commit 59f0381185
1 changed files with 4 additions and 0 deletions

View File

@ -67,10 +67,14 @@ void TestLineByLineLex::testFormatter_data()
{
QTest::addColumn<QString>("filename");
QDir formatData(m_baseDir + u"/qmlformat/data"_s);
bool hasTestData = false; // ### TODO: fix test to always have data
for (const QFileInfo &fInfo :
formatData.entryInfoList(QStringList({ u"*.qml"_s, u"*.js"_s }), QDir::Files)) {
QTest::newRow(qPrintable(fInfo.fileName())) << fInfo.absoluteFilePath();
hasTestData = true;
}
if (!hasTestData)
QSKIP("No test data found!");
}
void TestLineByLineLex::testFormatter()