forked from qt-creator/qt-creator
Squish: Don't configure Windows firewall when we don't need to
Task-number: QTCREATORBUG-20316 Change-Id: Ibec253f15a39dc22ab8bd1693eab38b0ab7b44fb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -76,8 +76,8 @@ Attention! If any of these prerequisites cannot be satisfied the tests will like
|
|||||||
|
|
||||||
Prerequisites - debugging and analyzing
|
Prerequisites - debugging and analyzing
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
In some tests, Creator needs to read data from an application it started.
|
In tst_simple_debug from suite_debbugger, Creator needs to read data from an application it
|
||||||
On Windows, those have the following prerequisites:
|
started. On Windows, this has the following prerequisites:
|
||||||
Either:
|
Either:
|
||||||
* have no firewall at all enabled (sure that's a bad idea)
|
* have no firewall at all enabled (sure that's a bad idea)
|
||||||
Or:
|
Or:
|
||||||
|
@@ -165,54 +165,6 @@ def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=Fa
|
|||||||
test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo)
|
test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo)
|
||||||
return qtVersion
|
return qtVersion
|
||||||
|
|
||||||
def getQtInformationForQmlProject():
|
|
||||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
|
||||||
kit = __getTargetFromToolTip__(str(fancyToolButton.toolTip))
|
|
||||||
if not kit:
|
|
||||||
test.fatal("Could not figure out which kit you're using...")
|
|
||||||
return None
|
|
||||||
test.log("Searching for Qt information for kit '%s'" % kit)
|
|
||||||
invokeMenuItem("Tools", "Options...")
|
|
||||||
waitForObjectItem(":Options_QListView", "Build & Run")
|
|
||||||
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
|
|
||||||
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"))
|
|
||||||
return None
|
|
||||||
qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
|
|
||||||
test.log("Kit '%s' uses Qt Version '%s'" % (kit, qtVersionStr))
|
|
||||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions")
|
|
||||||
treeView = waitForObject(":qtdirList_QTreeView")
|
|
||||||
if not __selectTreeItemOnBuildAndRun__(treeView, qtVersionStr):
|
|
||||||
test.fatal("Found no matching Qt Version for kit - this shouldn't happen.")
|
|
||||||
clickButton(waitForObject(":Options.Cancel_QPushButton"))
|
|
||||||
return None
|
|
||||||
qmake = str(waitForObject(":QtSupport__Internal__QtVersionManager.qmake_QLabel").text)
|
|
||||||
test.log("Qt Version '%s' uses qmake at '%s'" % (qtVersionStr, qmake))
|
|
||||||
clickButton(waitForObject(":Options.Cancel_QPushButton"))
|
|
||||||
return qmake
|
|
||||||
|
|
||||||
def __selectTreeItemOnBuildAndRun__(treeViewOrWidget, itemText, isRegex=False):
|
|
||||||
model = treeViewOrWidget.model()
|
|
||||||
test.compare(model.rowCount(), 2, "Verifying expected section count")
|
|
||||||
autoDetected = model.index(0, 0)
|
|
||||||
test.compare(autoDetected.data().toString(), "Auto-detected", "Verifying label for section")
|
|
||||||
manual = model.index(1, 0)
|
|
||||||
test.compare(manual.data().toString(), "Manual", "Verifying label for section")
|
|
||||||
if isRegex:
|
|
||||||
pattern = re.compile(itemText)
|
|
||||||
for section in [autoDetected, manual]:
|
|
||||||
for dumpedItem in dumpItems(model, section):
|
|
||||||
if (isRegex and pattern.match(dumpedItem)
|
|
||||||
or itemText == dumpedItem):
|
|
||||||
item = ".".join([str(section.data().toString()),
|
|
||||||
dumpedItem.replace(".", "\\.").replace("_", "\\_")])
|
|
||||||
clickItem(treeViewOrWidget, item, 5, 5, 0, Qt.LeftButton)
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def __getTargetFromToolTip__(toolTip):
|
def __getTargetFromToolTip__(toolTip):
|
||||||
if toolTip == None or not isinstance(toolTip, (str, unicode)):
|
if toolTip == None or not isinstance(toolTip, (str, unicode)):
|
||||||
test.warning("Parameter toolTip must be of type str or unicode and can't be None!")
|
test.warning("Parameter toolTip must be of type str or unicode and can't be None!")
|
||||||
|
@@ -97,13 +97,6 @@ def performDebugging(projectName, checkedTargets):
|
|||||||
invokeMenuItem("Build", "Rebuild All")
|
invokeMenuItem("Build", "Rebuild All")
|
||||||
waitForCompile()
|
waitForCompile()
|
||||||
isMsvc = isMsvcConfig(len(checkedTargets), kit)
|
isMsvc = isMsvcConfig(len(checkedTargets), kit)
|
||||||
if platform.system() in ('Microsoft' 'Windows'):
|
|
||||||
switchViewTo(ViewConstants.PROJECTS)
|
|
||||||
switchToBuildOrRunSettingsFor(len(checkedTargets), kit, ProjectSettings.BUILD)
|
|
||||||
buildDir = os.path.join(str(waitForObject(":Qt Creator_Utils::BuildDirectoryLineEdit").text),
|
|
||||||
"debug")
|
|
||||||
switchViewTo(ViewConstants.EDIT)
|
|
||||||
allowAppThroughWinFW(buildDir, projectName, None)
|
|
||||||
clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))
|
clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))
|
||||||
handleDebuggerWarnings(config, isMsvc)
|
handleDebuggerWarnings(config, isMsvc)
|
||||||
waitForObject(":Qt Creator.DebugModeWidget_QSplitter")
|
waitForObject(":Qt Creator.DebugModeWidget_QSplitter")
|
||||||
@@ -118,5 +111,3 @@ def performDebugging(projectName, checkedTargets):
|
|||||||
clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton"))
|
clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton"))
|
||||||
__handleAppOutputWaitForDebuggerFinish__()
|
__handleAppOutputWaitForDebuggerFinish__()
|
||||||
removeOldBreakpoints()
|
removeOldBreakpoints()
|
||||||
if platform.system() in ('Microsoft' 'Windows'):
|
|
||||||
deleteAppFromWinFW(buildDir, projectName, None)
|
|
||||||
|
@@ -60,14 +60,6 @@ def main():
|
|||||||
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
|
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
|
||||||
"type='QCheckBox' unnamed='1' visible='1'}")
|
"type='QCheckBox' unnamed='1' visible='1'}")
|
||||||
switchViewTo(ViewConstants.EDIT)
|
switchViewTo(ViewConstants.EDIT)
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
|
||||||
qmake = getQtInformationForQmlProject()
|
|
||||||
if qmake == None:
|
|
||||||
earlyExit("Could not figure out which qmake is used.")
|
|
||||||
return
|
|
||||||
qmlScenePath = os.path.abspath(os.path.dirname(qmake))
|
|
||||||
qmlScene = "qmlscene.exe"
|
|
||||||
allowAppThroughWinFW(qmlScenePath, qmlScene, None)
|
|
||||||
clickButton(fancyDebugButton)
|
clickButton(fancyDebugButton)
|
||||||
locAndExprTV = waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
locAndExprTV = waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
||||||
# Locals and Expressions populates treeview only on demand - so the tree must be expanded
|
# Locals and Expressions populates treeview only on demand - so the tree must be expanded
|
||||||
@@ -96,8 +88,6 @@ def main():
|
|||||||
subItem = items
|
subItem = items
|
||||||
checkForExpectedValues(subItem, current[2], current[3])
|
checkForExpectedValues(subItem, current[2], current[3])
|
||||||
clickButton(waitForObject(':Debugger Toolbar.Exit Debugger_QToolButton', 5000))
|
clickButton(waitForObject(':Debugger Toolbar.Exit Debugger_QToolButton', 5000))
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
|
||||||
deleteAppFromWinFW(qmlScenePath, qmlScene)
|
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def __unfoldTree__():
|
def __unfoldTree__():
|
||||||
|
@@ -75,13 +75,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
|
|||||||
if not checkCompile():
|
if not checkCompile():
|
||||||
test.fatal("Compile had errors... Skipping current build config")
|
test.fatal("Compile had errors... Skipping current build config")
|
||||||
continue
|
continue
|
||||||
if platform.system() in ('Microsoft' 'Windows'):
|
|
||||||
switchViewTo(ViewConstants.PROJECTS)
|
|
||||||
switchToBuildOrRunSettingsFor(targetCount, kit, ProjectSettings.BUILD)
|
|
||||||
buildDir = os.path.join(str(waitForObject(":Qt Creator_Utils::BuildDirectoryLineEdit").text),
|
|
||||||
"debug")
|
|
||||||
switchViewTo(ViewConstants.EDIT)
|
|
||||||
allowAppThroughWinFW(buildDir, projectName, None)
|
|
||||||
switchViewTo(ViewConstants.DEBUG)
|
switchViewTo(ViewConstants.DEBUG)
|
||||||
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
|
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
|
||||||
recordButton = waitForObject("{container=':DebugModeWidget.Toolbar_QDockWidget' "
|
recordButton = waitForObject("{container=':DebugModeWidget.Toolbar_QDockWidget' "
|
||||||
@@ -131,8 +124,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
|
|||||||
elif str(model.index(row, colCalls).data()) == "2":
|
elif str(model.index(row, colCalls).data()) == "2":
|
||||||
test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(),
|
test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(),
|
||||||
"For two calls, median and longest time must be the same.")
|
"For two calls, median and longest time must be the same.")
|
||||||
if platform.system() in ('Microsoft' 'Windows'):
|
|
||||||
deleteAppFromWinFW(buildDir, projectName, None)
|
|
||||||
progressBarWait(15000, False) # wait for "Build" progressbar to disappear
|
progressBarWait(15000, False) # wait for "Build" progressbar to disappear
|
||||||
clickButton(waitForObject(":Analyzer Toolbar.Clear_QToolButton"))
|
clickButton(waitForObject(":Analyzer Toolbar.Clear_QToolButton"))
|
||||||
test.verify(waitFor("model.rowCount() == 0", 3000), "Analyzer results cleared.")
|
test.verify(waitFor("model.rowCount() == 0", 3000), "Analyzer results cleared.")
|
||||||
|
Reference in New Issue
Block a user