diff --git a/tests/system/objects.map b/tests/system/objects.map index 91d152682154ce2aae0b1b01d6a0e995859f304b..325f6931904159a8e120ae9aa76f6dd2eb44bf63 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -34,6 +34,7 @@ :Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'} :Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'} :Breakpoints_Debugger::Internal::BreakTreeView {container=':DebugModeWidget.Breakpoints_QDockWidget' type='Debugger::Internal::BreakTreeView' unnamed='1' visible='1'} +:BuildAndRun_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'} :CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Generator:_QLabel {text='Generator:' type='QLabel' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} @@ -49,9 +50,8 @@ :CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget {name='listWidget' type='QListWidget' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'} :CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox {name='protocolBox' type='QComboBox' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'} :CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog {name='CodePaster__Internal__PasteSelectDialog' type='CodePaster::PasteSelectDialog' visible='1'} -:Compiler:_QComboBox {aboveWidget=':CompilerPath.Utils_BaseValidatingLineEdit' container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':Compiler:_QLabel' type='QComboBox' unnamed='1' visible='1'} +:Compiler:_QComboBox {aboveWidget=':Path.Utils_BaseValidatingLineEdit' container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':Compiler:_QLabel' type='QComboBox' unnamed='1' visible='1'} :Compiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='Compiler:' type='QLabel' unnamed='1' visible='1'} -:CompilerPath.Utils_BaseValidatingLineEdit {container=':qt_tabwidget_stackedwidget_QWidget' name='LineEdit' type='Utils::BaseValidatingLineEdit' visible='1'} :Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'} :CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget' name='groupBox' title='Behavior' type='QGroupBox' visible='1'} :CreateProject_QStyleItem {clip='false' container=':Qt Creator_QDeclarativeView' enabled='true' text='Create Project' type='LinkedText' unnamed='1' visible='true'} @@ -97,7 +97,6 @@ :Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'} -:Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'} :Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'} :New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New Text File_Utils::FileWizardDialog'} @@ -118,6 +117,7 @@ :Options.qt_tabwidget_tabbar_QTabBar {name='qt_tabwidget_tabbar' type='QTabBar' visible='1' window=':Options_Core::Internal::SettingsDialog'} :Options_Core::Internal::SettingsDialog {type='Core::Internal::SettingsDialog' unnamed='1' visible='1' windowTitle~='(Options|Preferences)'} :Options_QListView {type='QListView' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'} +:Path.Utils_BaseValidatingLineEdit {container=':qt_tabwidget_stackedwidget_QWidget' name='LineEdit' type='Utils::BaseValidatingLineEdit' visible='1'} :QML Debugging.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':QML Debugging_QMessageBox'} :QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'} :QWebPage {type='QWebPage' unnamed='1'} diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py index 23e8327bbf5704d8ae2459916d86df7fca2a5d8d..4853afd3ad5982025e2807aaf757d3b803304e58 100644 --- a/tests/system/shared/project_explorer.py +++ b/tests/system/shared/project_explorer.py @@ -185,7 +185,7 @@ def getQtInformationForQmlProject(): waitForObjectItem(":Options_QListView", "Build & Run") clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton) clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") - targetsTreeView = waitForObject(":Kits_Or_Compilers_QTreeView") + targetsTreeView = waitForObject(":BuildAndRun_QTreeView") if not __selectTreeItemOnBuildAndRun__(targetsTreeView, "%s(\s\(default\))?" % kit, True): test.fatal("Found no matching kit - this shouldn't happen.") clickButton(waitForObject(":Options.Cancel_QPushButton")) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 073aa981e53c7513ecd54be90f30310bcaac7c28..b6ccff804d209f8833782c81503d801474a063a7 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -393,7 +393,7 @@ def getConfiguredKits(): return treeWidget.currentItem().text(0) # end of internal function for iterateQtVersions def __setQtVersionForKit__(kit, kitName, kitsQtVersionName): - treeView = waitForObject(":Kits_Or_Compilers_QTreeView") + treeView = waitForObject(":BuildAndRun_QTreeView") clickItem(treeView, kit, 5, 5, 0, Qt.LeftButton) qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText) kitsQtVersionName[kitName] = qtVersionStr @@ -446,7 +446,7 @@ def regexVerify(text, expectedTexts): def checkDebuggingLibrary(kitIDs): def __getQtVersionForKit__(kit, kitName): - treeView = waitForObject(":Kits_Or_Compilers_QTreeView") + treeView = waitForObject(":BuildAndRun_QTreeView") clickItem(treeView, kit, 5, 5, 0, Qt.LeftButton) return str(waitForObject(":Kits_QtVersion_QComboBox").currentText) # end of internal function for iterate kits @@ -598,7 +598,7 @@ def iterateKits(keepOptionsOpen=False, alreadyOnOptionsDialog=False, waitForObjectItem(":Options_QListView", "Build & Run") clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton) clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") - treeView = waitForObject(":Kits_Or_Compilers_QTreeView") + treeView = waitForObject(":BuildAndRun_QTreeView") model = treeView.model() test.compare(model.rowCount(), 2, "Verifying expected target section count") autoDetected = model.index(0, 0) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index a81a6b54a0764ea07a237694f0234d4fa4b9f900..65149c50f4200b33a5fe3ad76de92c6acf6dd04e 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -65,10 +65,18 @@ def __checkBuildAndRun__(): foundCompilers = [] foundCompilerNames = [] clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Compilers") - compilerTV = waitForObject(":Kits_Or_Compilers_QTreeView") + compilerTV = waitForObject(":BuildAndRun_QTreeView") __iterateTree__(compilerTV, __compFunc__, foundCompilers, foundCompilerNames) test.verify(__compareCompilers__(foundCompilers, expectedCompilers), "Verifying found and expected compilers are equal.") + # check debugger + expectedDebuggers = __getExpectedDebuggers__() + clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Debuggers") + foundDebugger = [] + debuggerTV = waitForObject(":BuildAndRun_QTreeView") + __iterateTree__(debuggerTV, __dbgFunc__, foundDebugger) + test.verify(__compareDebuggers__(foundDebugger, expectedDebuggers), + "Verifying found and expected debuggers are equal.") # check Qt versions qmakePath = which("qmake") foundQt = [] @@ -79,7 +87,7 @@ def __checkBuildAndRun__(): foundQt = foundQt[0] # check kits clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") - kitsTV = waitForObject(":Kits_Or_Compilers_QTreeView") + kitsTV = waitForObject(":BuildAndRun_QTreeView") __iterateTree__(kitsTV, __kitFunc__, foundQt, foundCompilerNames) def __iterateTree__(treeObj, additionalFunc, *additionalParameters): @@ -104,8 +112,8 @@ def __iterateTree__(treeObj, additionalFunc, *additionalParameters): def __compFunc__(it, foundComp, foundCompNames): try: - waitFor("object.exists(':CompilerPath.Utils_BaseValidatingLineEdit')", 1000) - pathLineEdit = findObject(":CompilerPath.Utils_BaseValidatingLineEdit") + waitFor("object.exists(':Path.Utils_BaseValidatingLineEdit')", 1000) + pathLineEdit = findObject(":Path.Utils_BaseValidatingLineEdit") foundComp.append(str(pathLineEdit.text)) except: label = findObject("{buddy={container=':qt_tabwidget_stackedwidget_QWidget' " @@ -114,6 +122,11 @@ def __compFunc__(it, foundComp, foundCompNames): foundComp.append({it:str(label.text)}) foundCompNames.append(it) +def __dbgFunc__(it, foundDbg): + waitFor("object.exists(':Path.Utils_BaseValidatingLineEdit')", 1000) + pathLineEdit = findObject(":Path.Utils_BaseValidatingLineEdit") + foundDbg.append(str(pathLineEdit.text)) + def __qtFunc__(it, foundQt, qmakePath): foundQt.append(it) qtPath = str(waitForObject(":QtSupport__Internal__QtVersionManager.qmake_QLabel").text) @@ -197,6 +210,26 @@ def __getWinEnvVars__(): os.remove(tmpFPath) return result +def __getExpectedDebuggers__(): + result = [] + if platform.system() in ('Microsoft', 'Windows'): + result.extend(__getCDB__()) + debuggers = ["gdb", "lldb"] + result.extend(filter(None, map(which, debuggers))) + return result + +def __getCDB__(): + result = [] + possibleLocations = ["C:\\Program Files\\Debugging Tools for Windows (x64)", + "C:\\Program Files (x86)\\Windows Kits\\8.0\\Debuggers\\x86", + "C:\\Program Files\\Windows Kits\\8.0\\Debuggers\\x86", + "C:\\Program Files (x86)\\Windows Kits\\8.1\\Debuggers\\x86", + "C:\\Program Files\\Windows Kits\\8.1\\Debuggers\\x86"] + for cdbPath in possibleLocations: + cdb = os.path.join(cdbPath, "cdb.exe") + if os.path.exists(cdb): + result.append(cdb) + return result def __compareCompilers__(foundCompilers, expectedCompilers): equal = True @@ -232,6 +265,24 @@ def __compareCompilers__(foundCompilers, expectedCompilers): break return equal +def __compareDebuggers__(foundDebuggers, expectedDebuggers): + if not len(foundDebuggers) == len(expectedDebuggers): + test.log("Number of found and expected debuggers do not match.", + "Found: %s\nExpected: %s" % (str(foundDebuggers), str(expectedDebuggers))) + return False + if platform.system() in ('Microsoft', 'Windows'): + foundSet = set(__lowerStrs__(foundDebuggers)) + expectedSet = set(__lowerStrs__(expectedDebuggers)) + else: + foundSet = set(foundDebuggers) + expectedSet = set(expectedDebuggers) + if not (test.verify(not foundSet.symmetric_difference(expectedSet), + "Verifying expected and found debuggers match.")): + test.log("Found debuggers: %s" % foundDebuggers, + "Expected debuggers: %s" % expectedDebuggers) + return False + return True + def __lowerStrs__(iterable): for it in iterable: if isinstance(it, (str, unicode)): @@ -246,7 +297,8 @@ def __checkCreatedSettings__(settingsFolder): files = [{os.path.join(qtProj, "QtCreator.db"):0}, {os.path.join(qtProj, "QtCreator.ini"):30}] folders.append(os.path.join(qtProj, "qtcreator")) - files.extend([{os.path.join(folders[0], "devices.xml"):0}, + files.extend([{os.path.join(folders[0], "debuggers.xml"):0}, + {os.path.join(folders[0], "devices.xml"):0}, {os.path.join(folders[0], "helpcollection.qhc"):0}, {os.path.join(folders[0], "profiles.xml"):0}, {os.path.join(folders[0], "qtversion.xml"):0},