diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py index 84d41562a20b08c64e0b54c26d0377ae51b354ff..cbeac8bd45549d2eea582106829d5709d9344df5 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py @@ -33,32 +33,35 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - # using a temporary directory won't mess up a potentially existing - workingDir = tempDir() - checkedTargets, projectName = createNewQtQuickApplication(workingDir, - targets = Targets.DESKTOP_474_GCC) - test.log("Building project") - result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223) - invokeMenuItem("Build", "Build All") - waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") - if not checkCompile(): - test.fatal("Compile failed") - else: - checkLastBuild() - test.log("Running project (includes build)") - if result: - result = addExecutableAsAttachableAUT(projectName, 11223) - allowAppThroughWinFW(workingDir, projectName) + for targ, qVer in {Targets.DESKTOP_480_GCC:1, Targets.DESKTOP_501_DEFAULT:2}.items(): + # using a temporary directory won't mess up a potentially existing + workingDir = tempDir() + checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targ, + qtQuickVersion=qVer) + test.log("Building project Qt Quick %d Application (%s)" + % (qVer, Targets.getStringForTarget(targ))) + result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223) + invokeMenuItem("Build", "Build All") + waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") + if not checkCompile(): + test.fatal("Compile failed") + else: + checkLastBuild() + test.log("Running project (includes build)") if result: - result = runAndCloseApp(True, projectName, 11223, "subprocessFunction", SubprocessType.QT_QUICK_APPLICATION) + result = addExecutableAsAttachableAUT(projectName, 11223) + allowAppThroughWinFW(workingDir, projectName) + if result: + result = runAndCloseApp(True, projectName, 11223, "subprocessFunction", SubprocessType.QT_QUICK_APPLICATION) + else: + result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION) + removeExecutableAsAttachableAUT(projectName, 11223) + deleteAppFromWinFW(workingDir, projectName) else: - result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION) - removeExecutableAsAttachableAUT(projectName, 11223) - deleteAppFromWinFW(workingDir, projectName) - else: - result = runAndCloseApp() - if result: - logApplicationOutput() + result = runAndCloseApp() + if result: + logApplicationOutput() + invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py index 90c2c1fcc4e460ae73831a1cbdd601c0e55ad811..925fff538d0229a75f5be72eb7de69a28acd86a3 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py @@ -30,40 +30,49 @@ source("../../shared/qtcreator.py") def main(): - sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection") - qmlFile = os.path.join("qml", "textselection.qml") - if not neededFilePresent(os.path.join(sourceExample, qmlFile)): + sourceExampleQt4 = os.path.join(sdkPath, "Examples", "4.7", "declarative", "text", + "textselection", "qml", "textselection.qml") + sourceExampleQt5 = os.path.join(qt5SDKPath(), "examples", "quick", "text", "textselection", + "textselection.qml") + if not neededFilePresent(sourceExampleQt4): + return + if not neededFilePresent(sourceExampleQt5): return startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - # using a temporary directory won't mess up a potentially existing - workingDir = tempDir() - checkedTargets, projectName = createNewQtQuickApplication(workingDir, None, - os.path.join(prepareTemplate(sourceExample), qmlFile), - Targets.DESKTOP_474_GCC) - test.log("Building project") - result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223) - invokeMenuItem("Build","Build All") - waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") - if not checkCompile(): - test.fatal("Compile failed") - else: - checkLastBuild() - test.log("Running project (includes build)") - if result: - result = addExecutableAsAttachableAUT(projectName, 11223) - allowAppThroughWinFW(workingDir, projectName) + targetsAndQuickVersion = {Targets.DESKTOP_480_GCC:[1, sourceExampleQt4], + Targets.DESKTOP_501_DEFAULT:[2, sourceExampleQt5]} + for targ, qVerAndEx in targetsAndQuickVersion.items(): + # using a temporary directory won't mess up a potentially existing + workingDir = tempDir() + checkedTargets, projectName = createNewQtQuickApplication(workingDir, None, + qVerAndEx[1], + targ, qVerAndEx[0]) + test.log("Building project Qt Quick %d Application (%s)" + % (qVerAndEx[0], Targets.getStringForTarget(targ))) + result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223) + invokeMenuItem("Build","Build All") + waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") + if not checkCompile(): + test.fatal("Compile failed") + else: + checkLastBuild() + test.log("Running project (includes build)") if result: - result = runAndCloseApp(True, projectName, 11223, subprocessFunction, SubprocessType.QT_QUICK_APPLICATION) + result = addExecutableAsAttachableAUT(projectName, 11223) + allowAppThroughWinFW(workingDir, projectName) + if result: + result = runAndCloseApp(True, projectName, 11223, subprocessFunction, SubprocessType.QT_QUICK_APPLICATION) + else: + result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION) + removeExecutableAsAttachableAUT(projectName, 11223) + deleteAppFromWinFW(workingDir, projectName) else: - result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION) - removeExecutableAsAttachableAUT(projectName, 11223) - deleteAppFromWinFW(workingDir, projectName) - else: - result = runAndCloseApp() - if result: - logApplicationOutput() + result = runAndCloseApp() + if result: + logApplicationOutput() + invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit") def subprocessFunction(): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index 918fb132c27ca4a37ac20bb731d8f1961a8d4a9a..86455b9e747ba62464a819db6940c6bb205f5ed7 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -33,29 +33,33 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - # using a temporary directory won't mess up a potentially existing - workingDir = tempDir() - projectName = createNewQtQuickUI(workingDir) - test.log("Running project") - # TODO replace this quickfix with a proper identification of kits - # changes to createNewQtQuickUI(...) after fixing QTCREATORBUG-8704 will probably handle this - kitCount = 2 - if platform.system() in ('Windows', 'Microsoft'): - kitCount = 3 - qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, 11223) - if qmlViewer!=None: - qmlViewerPath = os.path.dirname(qmlViewer) - qmlViewer = os.path.basename(qmlViewer) - result = addExecutableAsAttachableAUT(qmlViewer, 11223) - allowAppThroughWinFW(qmlViewerPath, qmlViewer, None) - if result: - result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI) + for quickVersion in [1, 2]: + # using a temporary directory won't mess up a potentially existing + workingDir = tempDir() + projectName = createNewQtQuickUI(workingDir, quickVersion) + test.log("Running project Qt Quick %d UI" % quickVersion) + # TODO replace this quickfix with a proper identification of kits + # changes to createNewQtQuickUI(...) after fixing QTCREATORBUG-8704 will probably handle this + kitCount = 1 + if quickVersion == 1: + kitCount = 3 + if platform.system() in ('Windows', 'Microsoft'): + kitCount = 4 + qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, 11223) + if qmlViewer!=None: + qmlViewerPath = os.path.dirname(qmlViewer) + qmlViewer = os.path.basename(qmlViewer) + result = addExecutableAsAttachableAUT(qmlViewer, 11223) + allowAppThroughWinFW(qmlViewerPath, qmlViewer, None) + if result: + result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI) + else: + result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI) + removeExecutableAsAttachableAUT(qmlViewer, 11223) + deleteAppFromWinFW(qmlViewerPath, qmlViewer) else: result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI) - removeExecutableAsAttachableAUT(qmlViewer, 11223) - deleteAppFromWinFW(qmlViewerPath, qmlViewer) - else: - result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI) - if result: - logApplicationOutput() + if result: + logApplicationOutput() + invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py index d8bf0f7a33eb71b6579c1947f2fff76c6df9a2d5..7082b6188a7a982e8db3abe330c80fd5bcb018b3 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py @@ -33,13 +33,16 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - # using a temporary directory won't mess up a potentially existing - createNewQmlExtension(tempDir()) - # wait for parsing to complete - progressBarWait(30000) - test.log("Building project") - invokeMenuItem("Build","Build All") - waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") - checkCompile() - checkLastBuild() + for targ, quickVer in {Targets.DESKTOP_480_GCC:1, Targets.DESKTOP_501_DEFAULT:2}.items(): + # using a temporary directory won't mess up a potentially existing + createNewQmlExtension(tempDir(), targ, quickVer) + # wait for parsing to complete + progressBarWait(30000) + test.log("Building project Qt Quick %d Extension Plugin (%s)" + % (quickVer, Targets.getStringForTarget(targ))) + invokeMenuItem("Build","Build All") + waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") + checkCompile() + checkLastBuild() + invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit")