Squish: Enclose code model tests in sections

Change-Id: I4478acfc5ea7b3fa22d1cd17576e04fdda81dbb9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2017-09-01 15:23:34 +02:00
parent 2760b9fc67
commit b58dadfecc
10 changed files with 326 additions and 307 deletions

View File

@@ -2,7 +2,7 @@ Prerequisites - general information
-----------------------------------
Squish tests inside this folder have several prerequisites to get them running.
First - and most important - you have to own a valid Squish license. Currently it's recommended to use Squish 6.0.
First - and most important - you have to own a valid Squish license. At least Squish 6.0 is required.
Second - some of the test suites/test cases expect a build of Qt 4.8.7 to be available:
1. Download the source code from:

View File

@@ -61,11 +61,13 @@ def __openCodeModelOptions__():
clickItem(":Options_QListView", "C++", 14, 15, 0, Qt.LeftButton)
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Code Model")
def checkCodeModelSettings(useClang):
def getCodeModelString(useClang):
codeModelName = "built-in"
if useClang:
codeModelName = "Clang"
test.log("Testing code model: %s" % codeModelName)
return "Testing code model: %s" % codeModelName
def checkCodeModelSettings(useClang):
__openCodeModelOptions__()
test.verify(verifyChecked("{name='ignorePCHCheckBox' type='QCheckBox' visible='1'}"),
"Verifying whether 'Ignore pre-compiled headers' is checked by default.")

View File

@@ -231,3 +231,13 @@ class Qt5Path:
path = "Docs/Qt-5.%d" % qtMinorVersion
return os.path.join(Qt5Path.__createPlatformQtPath__(qtMinorVersion), path)
class TestSection:
def __init__(self, description):
self.description = description
def __enter__(self):
test.startSection(self.description)
def __exit__(self, exc_type, exc_value, traceback):
test.endSection()

View File

@@ -44,6 +44,7 @@ def triggerCompletion(editorWidget):
# entry of test
def main():
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
# create qt quick application

View File

@@ -28,6 +28,7 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
# create qt quick application

View File

@@ -76,6 +76,7 @@ def main():
"do while" : ["", "int dummy = 0;", "do", "++dummy;", "while (dummy < 10);"]
}
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
projectName = createNewNonQtProject()

View File

@@ -36,6 +36,7 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
# open example project

View File

@@ -36,6 +36,7 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
# open example project

View File

@@ -162,6 +162,7 @@ def main():
templateDir = prepareTemplate(examplePath)
examplePath = os.path.join(templateDir, "cplusplus-tools.pro")
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
openQmakeProject(examplePath, [Targets.DESKTOP_531_DEFAULT])

View File

@@ -27,6 +27,7 @@ source("../../shared/qtcreator.py")
def main():
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if not startCreator(useClang):
continue
createProject_Qt_Console(tempDir(), "SquishProject")