diff options
author | Christian Stenger <christian.stenger@digia.com> | 2013-08-08 11:26:13 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2013-08-28 09:21:34 +0200 |
commit | 4433f7aadd876d86b61f0a3801ca7928cfa4e0d3 (patch) | |
tree | 7787bf28a77157606075d72265b6119565eecd4b /tests | |
parent | 393792956f8dad320868975db6caac9bebe54083 (diff) | |
download | qt-creator-4433f7aadd876d86b61f0a3801ca7928cfa4e0d3.tar.gz |
Squish: Enable running on Qt5
Change-Id: Id74f1f2162542cbac98f86bc0c0b049334cdf035
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Diffstat (limited to 'tests')
10 files changed, 38 insertions, 33 deletions
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 58a0531c36..4fef60e3bf 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -33,11 +33,11 @@ import re processStarted = False processExited = False -def __handleProcessStarted__(object): +def __handleProcessStarted__(*args): global processStarted processStarted = True -def __handleProcessExited__(object, exitCode): +def __handleProcessExited__(*args): global processExited processExited = True @@ -330,8 +330,8 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None global processStarted, processExited processStarted = processExited = False overrideInstallLazySignalHandler() - installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processStarted()", "__handleProcessStarted__") - installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processExited(int)", "__handleProcessExited__") + installLazySignalHandler("{type='QProcess'}", "started()", "__handleProcessStarted__") + installLazySignalHandler("{type='QProcess'}", "finished(int,QProcess::ExitStatus)", "__handleProcessExited__") runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") clickButton(runButton) if sType != SubprocessType.QT_QUICK_UI: @@ -445,7 +445,7 @@ def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefT "Using fallback of pushing STOP inside Creator.") resetApplicationContextToCreator() __closeSubprocessByPushingStop__(sType) - waitFor("processExited==True", 10000) + waitFor("processExited==True and 'exited with code' in str(output.plainText)", 10000) if not processExited: test.warning("Sub-process seems not to have closed properly.") try: diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index 7fec62e421..d1d4180bef 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -84,8 +84,8 @@ def main(): invokeMenuItem("File", "Save All") invokeMenuItem("File", "Exit") -def __handleFutureProgress__(obj): +def __handleFutureProgress__(*args): global searchFinished - if className(obj) == "Core::FutureProgress": + if className(args[0]) == "Core::FutureProgress": searchFinished = True diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index 2c0c7c8dc8..0f931071bb 100755 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -35,19 +35,20 @@ gettingStartedText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='Getting Started'") # wait until help gets loaded -def webPageContentLoaded(obj, param): +def webPageContentLoaded(*args): global webPageContentLoadedValue - objectClass = str(obj.metaObject().className()) + objectClass = str(args[0].metaObject().className()) if objectClass in ("QWebPage", "Help::Internal::HelpViewer"): webPageContentLoadedValue += 1 -def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboText, testDetails): +def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboRegex, testDetails): global gettingStartedText webPageContentLoadedValue = 0 mouseClick(waitForObject(qmlItem), 5, 5, 0, Qt.LeftButton) waitFor("webPageContentLoadedValue == 4", 5000) - test.compare(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText, - expectedHelpComboText, testDetails) + foundText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) + if not test.verify(re.match(expectedHelpComboRegex, foundText), testDetails): + test.log("Found %s" % foundText) # select "Welcome" page from left toolbar again switchViewTo(ViewConstants.WELCOME) test.verify(checkIfObjectExists(gettingStartedText), @@ -68,7 +69,7 @@ def main(): mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, "text='Getting Started'")), 5, 5, 0, Qt.LeftButton) qmlItem = getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, "text='User Guide'") - expectedText = "QtCreator : Qt Creator Manual" + expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)" testDetails = "Verifying: Help with Creator Documentation is being opened." # select "User Guide" topic clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails) @@ -80,12 +81,12 @@ def main(): "text='Blogs'")), "Verifying: Link to Planet Qt exists.") qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='IDE Overview'") - expectedText = "QtCreator : IDE Overview" + expectedText = "(QtCreator : IDE Overview)|(IDE Overview [|] QtCreator)" testDetails = "Verifying: Help with IDE Overview topic is being opened." # select "IDE Overview" clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails) qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='User Interface'") - expectedText = "QtCreator : User Interface" + expectedText = "(QtCreator : User Interface)|(User Interface [|]) QtCreator" testDetails = "Verifying: Help with User Interface topic is being opened." # select "User interface" clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails) @@ -95,7 +96,8 @@ def main(): "text='Building and Running an Example Application'")), 5, 5, 0, Qt.LeftButton) waitFor("webPageContentLoadedValue == 4", 5000) - checkPattern = "QtCreator : Building and Running an Example( Application)?" + checkPattern = ("(QtCreator : Building and Running an Example( Application)?)" + "|(Building and Running an Example( Application)? [|] QtCreator)") checkText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) if not test.verify(re.search(checkPattern, checkText), "Verifying: Building and Running an Example is opened."): diff --git a/tests/system/suite_WELP/tst_WELP03/test.py b/tests/system/suite_WELP/tst_WELP03/test.py index eda1f1a04d..9f9e9e2527 100644 --- a/tests/system/suite_WELP/tst_WELP03/test.py +++ b/tests/system/suite_WELP/tst_WELP03/test.py @@ -33,9 +33,9 @@ source("../../shared/suites_qtta.py") webPageContentLoadedValue = 0 # wait until help gets loaded -def webPageContentLoaded(obj, param): +def webPageContentLoaded(*args): global webPageContentLoadedValue - objectClass = str(obj.metaObject().className()) + objectClass = str(args[0].metaObject().className()) if objectClass in ("QWebPage", "Help::Internal::HelpViewer"): webPageContentLoadedValue += 1 diff --git a/tests/system/suite_editors/tst_basic_cpp_support/test.py b/tests/system/suite_editors/tst_basic_cpp_support/test.py index b009b5d6f6..aff2ac3677 100644 --- a/tests/system/suite_editors/tst_basic_cpp_support/test.py +++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py @@ -112,7 +112,7 @@ def main(): test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)") invokeMenuItem("File", "Exit") -def __handleTextChanged__(object): +def __handleTextChanged__(*args): global textChanged textChanged = True diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index 658af27ea0..06a256a015 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -206,7 +206,7 @@ def maskSpecialCharsForProjectTree(filename): filename = filename.replace("/?","\\?").replace("/*","\\*") return filename -def __handleFutureProgress__(obj): +def __handleFutureProgress__(*args): global searchFinished - if className(obj) == "Core::FutureProgress": + if className(args[0]) == "Core::FutureProgress": searchFinished = True diff --git a/tests/system/suite_editors/tst_qml_indent/test.py b/tests/system/suite_editors/tst_qml_indent/test.py index 214b36c004..fb6989915e 100644 --- a/tests/system/suite_editors/tst_qml_indent/test.py +++ b/tests/system/suite_editors/tst_qml_indent/test.py @@ -76,7 +76,7 @@ def prepareQmlFile(): editor.plainText = "\n".join([line.lstrip() for line in lines]) + "\n" return True -def handleTextChanged(object): +def handleTextChanged(*args): global textHasChanged textHasChanged = True diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index 1c27f4f34d..a019fdd59e 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -160,6 +160,6 @@ def enableMaddePlugin(): "occurrence='%d'}" % (devSupport, maddePos)), 5, 5, 0, Qt.LeftButton) clickButton(":Installed Plugins.Close_QPushButton") -def __handleTextChanged__(object): +def __handleTextChanged__(*args): global textChanged textChanged = True diff --git a/tests/system/suite_general/tst_installed_languages/test.py b/tests/system/suite_general/tst_installed_languages/test.py index 52f525e611..5fa65888f5 100644 --- a/tests/system/suite_general/tst_installed_languages/test.py +++ b/tests/system/suite_general/tst_installed_languages/test.py @@ -40,6 +40,9 @@ def main(): clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton) clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General") languageName = testData.field(lang, "language") + if "%1" in languageName: + country = str(QLocale.countryToString(QLocale(testData.field(lang, "ISO")).country())) + languageName = languageName.replace("%1", country) selectFromCombo(":User Interface.languageBox_QComboBox", languageName) clickButton(waitForObject(":Options.OK_QPushButton")) clickButton(waitForObject(":Restart required.OK_QPushButton")) diff --git a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv index 4cc86a7f9a..7a35729e4e 100644 --- a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv +++ b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv @@ -1,10 +1,10 @@ -"language" "File" "Exit" -"Czech (CzechRepublic)" "Soubor" "Ukončit" -"German (Germany)" "Datei" "Beenden" -"French (France)" "Fichier" "Quitter" -"Japanese (Japan)" "ファイル(F)" "終了(X)" -"Polish (Poland)" "Plik" "Zakończ" -"Russian (RussianFederation)" "Файл" "Выход" -"Slovenian (Slovenia)" "Datoteka" "Končaj" -"Chinese (China)" "文件(F)" "退出(X)" -"Chinese (Taiwan)" "檔案(F)" "離開(X)" +"language" "File" "Exit" "ISO" +"Czech (CzechRepublic)" "Soubor" "Ukončit" "cs_CZ" +"German (Germany)" "Datei" "Beenden" "de_DE" +"French (France)" "Fichier" "Quitter" "fr_FR" +"Japanese (Japan)" "ファイル(F)" "終了(X)" "ja_JP" +"Polish (Poland)" "Plik" "Zakończ" "pl_PL" +"Russian (%1)" "Файл" "Выход" "ru_RU" +"Slovenian (Slovenia)" "Datoteka" "Končaj" "sl_SL" +"Chinese (China)" "文件(F)" "退出(X)" "zh_CN" +"Chinese (Taiwan)" "檔案(F)" "離開(X)" "zh_TW" |