SquishTest: Clone sources just in time for testing qbs

...to decouple them from the sources used in other tests.

Change-Id: I80b3ea1478cdffdc28933e4320971f98a11d1898
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2024-02-19 22:40:07 +01:00
parent 4a7f3db615
commit 871b91b843

View File

@@ -4,29 +4,34 @@
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
def main(): def main():
pathCreator = os.path.join(srcPath, "creator", "qtcreator.qbs") with GitClone("git://code.qt.io/qt-creator/qt-creator.git",
if not neededFilePresent(pathCreator): "v6.0.1") as CreatorSrcPath:
return if not CreatorSrcPath:
test.fatal("Could not clone Qt Creator")
return
pathCreator = os.path.join(CreatorSrcPath, "qtcreator.qbs")
startQC(["-noload", "ClangCodeModel"]) startQC(["-noload", "ClangCodeModel"])
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
openQbsProject(pathCreator) openQbsProject(pathCreator)
if not addAndActivateKit(Targets.DESKTOP_5_14_1_DEFAULT): if not addAndActivateKit(Targets.DESKTOP_5_14_1_DEFAULT):
test.fatal("Failed to activate '%s'" % Targets.getStringForTarget(Targets.DESKTOP_5_10_1_DEFAULT)) test.fatal("Failed to activate '%s'"
% Targets.getStringForTarget(Targets.DESKTOP_5_10_1_DEFAULT))
invokeMenuItem("File", "Exit")
return
test.log("Start parsing project")
rootNodeTemplate = ("{column='0' container=':Qt Creator_Utils::NavigationTreeView' "
"text~='%s( \[\S+\])?' type='QModelIndex'}")
ntwObject = waitForObject(rootNodeTemplate % "Qt Creator", 200000)
if waitFor("ntwObject.model().rowCount(ntwObject) > 2", 20000): # No need to wait for C++,
test.log("Parsing project done") # we only need the project
else:
test.warning("Parsing project timed out")
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
buildIssuesTexts = map(lambda i: str(i[0]), getBuildIssues(False))
deprecationWarnings = "\n".join(set(filter(lambda s: "deprecated" in s, buildIssuesTexts)))
if deprecationWarnings:
test.warning("Creator claims that the .qbs file uses deprecated features.",
deprecationWarnings)
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
return
test.log("Start parsing project")
rootNodeTemplate = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s( \[\S+\])?' type='QModelIndex'}"
ntwObject = waitForObject(rootNodeTemplate % "Qt Creator", 200000)
if waitFor("ntwObject.model().rowCount(ntwObject) > 2", 20000): # No need to wait for C++-parsing
test.log("Parsing project done") # we only need the project
else:
test.warning("Parsing project timed out")
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
buildIssuesTexts = map(lambda i: str(i[0]), getBuildIssues(False))
deprecationWarnings = "\n".join(set(filter(lambda s: "deprecated" in s, buildIssuesTexts)))
if deprecationWarnings:
test.warning("Creator claims that the .qbs file uses deprecated features.",
deprecationWarnings)
invokeMenuItem("File", "Exit")