forked from qt-creator/qt-creator
Squish: Use examples from Qt 5 in suite_CCOM
Task-number: QTCREATORBUG-15469 Change-Id: I147c0ff6d402b97a1737a4bb57697c88ac7838be Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -38,6 +38,8 @@ class Targets:
|
|||||||
DESKTOP_531_DEFAULT,
|
DESKTOP_531_DEFAULT,
|
||||||
DESKTOP_541_GCC) = ALL_TARGETS
|
DESKTOP_541_GCC) = ALL_TARGETS
|
||||||
|
|
||||||
|
DESKTOP_561_DEFAULT = sum(ALL_TARGETS) + 1
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def desktopTargetClasses():
|
def desktopTargetClasses():
|
||||||
desktopTargets = (sum(Targets.ALL_TARGETS) & ~Targets.SIMULATOR & ~Targets.EMBEDDED_LINUX)
|
desktopTargets = (sum(Targets.ALL_TARGETS) & ~Targets.SIMULATOR & ~Targets.EMBEDDED_LINUX)
|
||||||
@@ -69,6 +71,8 @@ class Targets:
|
|||||||
return "Desktop 531 default"
|
return "Desktop 531 default"
|
||||||
elif target == Targets.DESKTOP_541_GCC:
|
elif target == Targets.DESKTOP_541_GCC:
|
||||||
return "Desktop 541 GCC"
|
return "Desktop 541 GCC"
|
||||||
|
elif target == Targets.DESKTOP_561_DEFAULT:
|
||||||
|
return "Desktop 561 default"
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -192,6 +196,9 @@ class Qt5Path:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __preCheckAndExtractQtVersionStr__(target):
|
def __preCheckAndExtractQtVersionStr__(target):
|
||||||
if target not in Targets.ALL_TARGETS:
|
if target not in Targets.ALL_TARGETS:
|
||||||
|
# Ignore DESKTOP_561_DEFAULT which only delivers examples but not a kit yet.
|
||||||
|
# Remove the condition as soon as it is being used as a kit in tests.
|
||||||
|
if not target == Targets.DESKTOP_561_DEFAULT:
|
||||||
raise Exception("Unexpected target '%s'" % str(target))
|
raise Exception("Unexpected target '%s'" % str(target))
|
||||||
|
|
||||||
matcher = re.match("^Desktop (5\\d{2}).*$", Targets.getStringForTarget(target))
|
matcher = re.match("^Desktop (5\\d{2}).*$", Targets.getStringForTarget(target))
|
||||||
|
@@ -28,26 +28,20 @@ source("../../shared/qtcreator.py")
|
|||||||
# entry of test
|
# entry of test
|
||||||
def main():
|
def main():
|
||||||
# prepare example project
|
# prepare example project
|
||||||
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
|
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
|
||||||
proFile = "propertyanimation.pro"
|
"quick", "animation")
|
||||||
|
proFile = "animation.pro"
|
||||||
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
||||||
return
|
return
|
||||||
# copy example project to temp directory
|
# copy example project to temp directory
|
||||||
templateDir = prepareTemplate(sourceExample)
|
templateDir = prepareTemplate(sourceExample, "/../shared")
|
||||||
examplePath = os.path.join(templateDir, proFile)
|
examplePath = os.path.join(templateDir, proFile)
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
# open example project
|
# open example project, supports only Qt 5
|
||||||
# qmlapplicationviewer of this example supports only Qt version < 5
|
targets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC & ~Targets.DESKTOP_480_DEFAULT
|
||||||
targets = (Targets.desktopTargetClasses() & ~Targets.DESKTOP_521_DEFAULT
|
|
||||||
& ~Targets.DESKTOP_531_DEFAULT & ~Targets.DESKTOP_541_GCC)
|
|
||||||
checkedTargets = openQmakeProject(examplePath, targets)
|
checkedTargets = openQmakeProject(examplePath, targets)
|
||||||
if not replaceLine("propertyanimation.Sources.main\\.cpp",
|
|
||||||
"#include <QtGui/QApplication>",
|
|
||||||
"#include <QApplication>"):
|
|
||||||
return
|
|
||||||
invokeMenuItem("File", "Save All")
|
|
||||||
# build and wait until finished - on all build configurations
|
# build and wait until finished - on all build configurations
|
||||||
availableConfigs = iterateBuildConfigs(len(checkedTargets))
|
availableConfigs = iterateBuildConfigs(len(checkedTargets))
|
||||||
if not availableConfigs:
|
if not availableConfigs:
|
||||||
|
@@ -29,22 +29,22 @@ source("../../shared/qtcreator.py")
|
|||||||
# entry of test
|
# entry of test
|
||||||
def main():
|
def main():
|
||||||
# prepare example project
|
# prepare example project
|
||||||
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
|
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
|
||||||
proFile = "propertyanimation.pro"
|
"quick", "animation")
|
||||||
|
proFile = "animation.pro"
|
||||||
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
||||||
return
|
return
|
||||||
# copy example project to temp directory
|
# copy example project to temp directory
|
||||||
templateDir = prepareTemplate(sourceExample)
|
templateDir = prepareTemplate(sourceExample, "/../shared")
|
||||||
examplePath = os.path.join(templateDir, proFile)
|
examplePath = os.path.join(templateDir, proFile)
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
# open example project
|
# open example project
|
||||||
targets = (Targets.desktopTargetClasses() & ~Targets.DESKTOP_521_DEFAULT
|
targets = Targets.desktopTargetClasses()
|
||||||
& ~Targets.DESKTOP_531_DEFAULT & ~Targets.DESKTOP_541_GCC)
|
|
||||||
openQmakeProject(examplePath, targets)
|
openQmakeProject(examplePath, targets)
|
||||||
# create syntax error
|
# create syntax error
|
||||||
openDocument("propertyanimation.QML.qml.property-animation\\.qml")
|
openDocument("animation.Resources.animation\\.qrc./animation.basics.property-animation\\.qml")
|
||||||
if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "Image {", "SyntaxError"):
|
if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "Image {", "SyntaxError"):
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user