forked from qt-creator/qt-creator
SquishTests: Update reading build issues
Fixes tst_build_new_project, tst_CCOM02 et al. tst_tasks_handling fails which might be an actual issue, reported in: Task-number: QTCREATORBUG-29209 Change-Id: I5eae54df27d8ba8f441e5b9c4acdaa2b41716245 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -273,6 +273,8 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const
|
||||
return task.summary;
|
||||
case TaskModel::Description:
|
||||
return task.description();
|
||||
case TaskModel::Type:
|
||||
return int(task.type);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
int sizeOfLineNumber(const QFont &font);
|
||||
void setFileNotFound(const QModelIndex &index, bool b);
|
||||
|
||||
enum Roles { Description = Qt::UserRole, };
|
||||
enum Roles { Description = Qt::UserRole, Type};
|
||||
|
||||
int taskCount(Utils::Id categoryId);
|
||||
int errorTaskCount(Utils::Id categoryId);
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
:Qt Creator.DragDoc_QToolButton {toolTip='Drag to drag documents between splits' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:Qt Creator.Events_QDockWidget {name='QmlProfiler.Statistics.DockDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:Qt Creator.Events_QTabBar {aboveWidget=':Qt Creator.Events_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'}
|
||||
:Qt Creator.Issues_QListView {type='Utils::TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'}
|
||||
:Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu'}
|
||||
:Qt Creator.Project.Menu.Folder_QMenu {name='Project.Menu.Folder' type='QMenu' visible='1'}
|
||||
:Qt Creator.QML debugging and profiling:_QComboBox {leftWidget=':Qt Creator.QML debugging and profiling:_QLabel' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
|
||||
@@ -47,7 +47,7 @@ def checkLastBuild(expectedToFail=False):
|
||||
test.log("checkLastBuild called without a build")
|
||||
return
|
||||
buildIssues = getBuildIssues()
|
||||
types = [i[5] for i in buildIssues]
|
||||
types = [i[1] for i in buildIssues]
|
||||
errors = types.count("1")
|
||||
warnings = types.count("2")
|
||||
gotErrors = errors != 0
|
||||
@@ -89,7 +89,7 @@ def dumpBuildIssues(listModel):
|
||||
issueDump = []
|
||||
for index in dumpIndices(listModel):
|
||||
issueDump.extend([[str(index.data(role).toString()) for role
|
||||
in range(Qt.UserRole, Qt.UserRole + 6)]])
|
||||
in range(Qt.UserRole, Qt.UserRole + 2)]])
|
||||
return issueDump
|
||||
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
|
||||
if(warnIfMoreIssues and issuesModel.rowCount() > 1):
|
||||
test.warning("More than one expected issues reported")
|
||||
# iterate issues and check if there exists "Unexpected token" message
|
||||
for description, type in zip(dumpItems(issuesModel, role=Qt.UserRole + 3),
|
||||
dumpItems(issuesModel, role=Qt.UserRole + 5)):
|
||||
# enum Roles { File = Qt::UserRole, Line, MovedLine, Description, FileNotFound, Type, Category, Icon, Task_t };
|
||||
for description, type in zip(dumpItems(issuesModel, role=Qt.UserRole),
|
||||
dumpItems(issuesModel, role=Qt.UserRole + 1)):
|
||||
# enum Roles { Description = Qt::UserRole, Type};
|
||||
# check if at least one of expected texts found in issue text
|
||||
for expectedText in expectedTextsArray:
|
||||
if expectedText in description:
|
||||
|
||||
@@ -27,11 +27,11 @@ def __noBuildIssues__():
|
||||
def __syntaxErrorDetected__():
|
||||
buildIssues = getBuildIssues(False)
|
||||
for issue in buildIssues:
|
||||
if issue[3] in ["Expected ';' after expression (fix available)",
|
||||
if issue[0] in ["Expected ';' after expression (fix available)",
|
||||
"Expected ';' at end of declaration (fix available)",
|
||||
"Use of undeclared identifier 'syntaxError'"]:
|
||||
return True
|
||||
if re.match(issue[3], "Declaration of reference variable '.+' requires an initializer"):
|
||||
if re.match(issue[0], "Declaration of reference variable '.+' requires an initializer"):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ def main():
|
||||
else:
|
||||
test.warning("Parsing project timed out")
|
||||
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
|
||||
buildIssuesTexts = map(lambda i: str(i[3]), getBuildIssues())
|
||||
buildIssuesTexts = map(lambda i: str(i[0]), getBuildIssues())
|
||||
deprecationWarnings = filter(lambda s: "deprecated" in s, buildIssuesTexts)
|
||||
if deprecationWarnings:
|
||||
test.warning("Creator claims that the .qbs file uses deprecated features.",
|
||||
|
||||
@@ -58,7 +58,7 @@ def checkOrUncheckMyTasks():
|
||||
"My Tasks"))
|
||||
|
||||
def getBuildIssuesTypeCounts(model):
|
||||
issueTypes = list(map(lambda x: x.data(Qt.UserRole + 5).toInt(), dumpIndices(model)))
|
||||
issueTypes = list(map(lambda x: x.data(Qt.UserRole + 1).toInt(), dumpIndices(model)))
|
||||
result = [issueTypes.count(0), issueTypes.count(1), issueTypes.count(2)]
|
||||
if len(issueTypes) != sum(result):
|
||||
test.fatal("Found unexpected value(s) for TaskType...")
|
||||
|
||||
Reference in New Issue
Block a user