forked from qt-creator/qt-creator
Squish: Replaced lot of signal code by one simple function
Change-Id: Idb6b663a8b2be217d8769fab5e2f6f9290f37990 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -29,38 +29,9 @@
|
||||
|
||||
import re;
|
||||
|
||||
# dictionary to hold a list of all installed handler functions for all object-signalSignature pairs
|
||||
installedSignalHandlers = {}
|
||||
# flag to indicate whether overrideInstallLazySignalHandler() has been called already
|
||||
overridenInstallLazySignalHandlers = False
|
||||
# flag to indicate whether a tasks file should be created when building ends with errors
|
||||
createTasksFileOnError = True
|
||||
|
||||
# call this function to override installLazySignalHandler()
|
||||
def overrideInstallLazySignalHandler():
|
||||
global overridenInstallLazySignalHandlers
|
||||
if overridenInstallLazySignalHandlers:
|
||||
return
|
||||
overridenInstallLazySignalHandlers = True
|
||||
global installLazySignalHandler
|
||||
installLazySignalHandler = __addSignalHandlerDict__(installLazySignalHandler)
|
||||
|
||||
# avoids adding a handler to a signal twice or more often
|
||||
# do not call this function directly - use overrideInstallLazySignalHandler() instead
|
||||
def __addSignalHandlerDict__(lazySignalHandlerFunction):
|
||||
global installedSignalHandlers
|
||||
def wrappedFunction(name, signalSignature, handlerFunctionName):
|
||||
handlers = installedSignalHandlers.get("%s____%s" % (name,signalSignature))
|
||||
if handlers == None:
|
||||
lazySignalHandlerFunction(name, signalSignature, handlerFunctionName)
|
||||
installedSignalHandlers.setdefault("%s____%s" % (name,signalSignature), [handlerFunctionName])
|
||||
else:
|
||||
if not handlerFunctionName in handlers:
|
||||
lazySignalHandlerFunction(name, signalSignature, handlerFunctionName)
|
||||
handlers.append(handlerFunctionName)
|
||||
installedSignalHandlers.setdefault("%s____%s" % (name,signalSignature), handlers)
|
||||
return wrappedFunction
|
||||
|
||||
# this method checks the last build (if there's one) and logs the number of errors, warnings and
|
||||
# lines within the Issues output
|
||||
# optional parameter can be used to tell this function if the build was expected to fail or not
|
||||
@@ -105,6 +76,12 @@ def compileSucceeded(compileOutput):
|
||||
return None != re.match(".*exited normally\.\n\d\d:\d\d:\d\d: Elapsed time: "
|
||||
"(\d:)?\d{2}:\d\d\.$", str(compileOutput), re.S)
|
||||
|
||||
def waitForCompile(timeout=60000):
|
||||
ensureChecked(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton")
|
||||
output = waitForObject(":Qt Creator.Compile Output_Core::OutputWindow")
|
||||
if not waitFor("re.match('.*Elapsed time: (\d:)?\d{2}:\d\d\.$', str(output.plainText), re.S)", timeout):
|
||||
test.warning("Waiting for compile timed out after %d s." % (timeout / 1000))
|
||||
|
||||
def dumpBuildIssues(listModel):
|
||||
issueDump = []
|
||||
for row in range(listModel.rowCount()):
|
||||
|
||||
Reference in New Issue
Block a user