diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-09-13 08:38:53 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-09-15 14:33:28 +0200 |
commit | 59f0381185e1c5f5089786d52fccb4cfa33a4a24 (patch) | |
tree | de2ba69e01b9a9355755a0835f557f9140597511 | |
parent | ff5b714fdc8eddd75590fba4f95f1d782b36ad98 (diff) |
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>
-rw-r--r-- | tests/auto/qml/linebylinelex/tst_linebylinelex.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qml/linebylinelex/tst_linebylinelex.cpp b/tests/auto/qml/linebylinelex/tst_linebylinelex.cpp index 64dcc9a4ed..02ce1f33f3 100644 --- a/tests/auto/qml/linebylinelex/tst_linebylinelex.cpp +++ b/tests/auto/qml/linebylinelex/tst_linebylinelex.cpp @@ -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() |