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_541_GCC) = ALL_TARGETS
|
||||
|
||||
DESKTOP_561_DEFAULT = sum(ALL_TARGETS) + 1
|
||||
|
||||
@staticmethod
|
||||
def desktopTargetClasses():
|
||||
desktopTargets = (sum(Targets.ALL_TARGETS) & ~Targets.SIMULATOR & ~Targets.EMBEDDED_LINUX)
|
||||
@@ -69,6 +71,8 @@ class Targets:
|
||||
return "Desktop 531 default"
|
||||
elif target == Targets.DESKTOP_541_GCC:
|
||||
return "Desktop 541 GCC"
|
||||
elif target == Targets.DESKTOP_561_DEFAULT:
|
||||
return "Desktop 561 default"
|
||||
else:
|
||||
return None
|
||||
|
||||
@@ -192,6 +196,9 @@ class Qt5Path:
|
||||
@staticmethod
|
||||
def __preCheckAndExtractQtVersionStr__(target):
|
||||
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))
|
||||
|
||||
matcher = re.match("^Desktop (5\\d{2}).*$", Targets.getStringForTarget(target))
|
||||
|
@@ -28,26 +28,20 @@ source("../../shared/qtcreator.py")
|
||||
# entry of test
|
||||
def main():
|
||||
# prepare example project
|
||||
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
|
||||
proFile = "propertyanimation.pro"
|
||||
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
|
||||
"quick", "animation")
|
||||
proFile = "animation.pro"
|
||||
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
||||
return
|
||||
# copy example project to temp directory
|
||||
templateDir = prepareTemplate(sourceExample)
|
||||
templateDir = prepareTemplate(sourceExample, "/../shared")
|
||||
examplePath = os.path.join(templateDir, proFile)
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# open example project
|
||||
# qmlapplicationviewer of this example supports only Qt version < 5
|
||||
targets = (Targets.desktopTargetClasses() & ~Targets.DESKTOP_521_DEFAULT
|
||||
& ~Targets.DESKTOP_531_DEFAULT & ~Targets.DESKTOP_541_GCC)
|
||||
# open example project, supports only Qt 5
|
||||
targets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC & ~Targets.DESKTOP_480_DEFAULT
|
||||
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
|
||||
availableConfigs = iterateBuildConfigs(len(checkedTargets))
|
||||
if not availableConfigs:
|
||||
|
@@ -29,22 +29,22 @@ source("../../shared/qtcreator.py")
|
||||
# entry of test
|
||||
def main():
|
||||
# prepare example project
|
||||
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
|
||||
proFile = "propertyanimation.pro"
|
||||
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
|
||||
"quick", "animation")
|
||||
proFile = "animation.pro"
|
||||
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
||||
return
|
||||
# copy example project to temp directory
|
||||
templateDir = prepareTemplate(sourceExample)
|
||||
templateDir = prepareTemplate(sourceExample, "/../shared")
|
||||
examplePath = os.path.join(templateDir, proFile)
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# open example project
|
||||
targets = (Targets.desktopTargetClasses() & ~Targets.DESKTOP_521_DEFAULT
|
||||
& ~Targets.DESKTOP_531_DEFAULT & ~Targets.DESKTOP_541_GCC)
|
||||
targets = Targets.desktopTargetClasses()
|
||||
openQmakeProject(examplePath, targets)
|
||||
# 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"):
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
|
Reference in New Issue
Block a user