Squish: Fix handling of test cases

Squish uses the test case entries inside the suite.conf
only for sorting and determining the run order.
In fact all folders inside a suite that match the common
pattern will be used.
Adapt our handling accordingly.

Change-Id: I57121bb7715c648b6f0416012c71227261e140b9
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2022-09-29 12:34:24 +02:00
parent 2d8f02fb0e
commit 0a7e6ef44f
2 changed files with 14 additions and 4 deletions

View File

@@ -251,8 +251,9 @@ void SquishNavigationWidget::onItemActivated(const QModelIndex &idx)
break;
}
if (!item->filePath().isEmpty())
Core::EditorManager::openEditor(Utils::FilePath::fromString(item->filePath()));
auto filePath = Utils::FilePath::fromString(item->filePath());
if (filePath.exists())
Core::EditorManager::openEditor(filePath);
}
void SquishNavigationWidget::onExpanded(const QModelIndex &idx)

View File

@@ -260,10 +260,19 @@ QStringList SuiteConf::validTestCases(const QString &baseDirectory)
const Utils::FilePath testCaseDir = subDir / testCase;
if (testCaseDir.isDir()) {
Utils::FilePath testCaseTest = testCaseDir.pathAppended("test" + extension);
if (testCaseTest.isFile())
validCases.append(testCaseTest.toString());
validCases.append(testCaseTest.toString());
}
}
// now unlisted matching tests (suite.conf's TEST_CASES is used for some ordering)
const Utils::FilePaths entries = subDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot);
for (const Utils::FilePath &entry : entries) {
if (!entry.fileName().startsWith("tst_"))
continue;
const QString testFileStr = entry.pathAppended("test" + extension).toString();
if (!validCases.contains(testFileStr))
validCases.append(testFileStr);
}
}
return validCases;
}