forked from qt-creator/qt-creator
Squish: Unify invoking add custom executable
Change-Id: If090ca16a9cc358ff38de5564d2e8ef2a2cf8200 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -111,29 +111,12 @@ def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, por
|
|||||||
executable = os.path.abspath(os.path.dirname(qmake) + "/qmlscene")
|
executable = os.path.abspath(os.path.dirname(qmake) + "/qmlscene")
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
executable = executable + ".exe"
|
executable = executable + ".exe"
|
||||||
addRunConfig = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' "
|
|
||||||
"type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' "
|
|
||||||
"visible='1'} occurrence='2' text='Add' type='QPushButton' "
|
|
||||||
"unnamed='1' visible='1'}")
|
|
||||||
clickButton(addRunConfig)
|
|
||||||
activateItem(waitForObject("{type='QMenu' visible='1' unnamed='1'}"), "Custom Executable")
|
|
||||||
exePathChooser = waitForObject(":Executable:_Utils::PathChooser")
|
|
||||||
exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit")
|
|
||||||
argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
|
|
||||||
"type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' "
|
|
||||||
"unnamed='1' visible='1'}")
|
|
||||||
wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
|
|
||||||
"text='Working directory:' type='QLabel'} "
|
|
||||||
"type='Utils::PathChooser' unnamed='1' visible='1'}")
|
|
||||||
wdLineEd = getChildByClass(wdPathChooser, "Utils::BaseValidatingLineEdit")
|
|
||||||
startAUT = os.path.abspath(squishPath + "/bin/startaut")
|
startAUT = os.path.abspath(squishPath + "/bin/startaut")
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
startAUT = startAUT + ".exe"
|
startAUT = startAUT + ".exe"
|
||||||
|
args = "--verbose --port=%d %s %s.qml" % (port, executable, projectName)
|
||||||
projectPath = os.path.abspath("%s/%s" % (workingDir, projectName))
|
projectPath = os.path.abspath("%s/%s" % (workingDir, projectName))
|
||||||
replaceEditorContent(exeLineEd, startAUT)
|
__invokeAddCustomExecutable__(startAUT, args, projectPath)
|
||||||
replaceEditorContent(argLineEd, "--verbose --port=%d %s %s.qml"
|
|
||||||
% (port, executable, projectName))
|
|
||||||
replaceEditorContent(wdLineEd, projectPath)
|
|
||||||
clickButton(waitForObject("{text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' "
|
clickButton(waitForObject("{text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' "
|
||||||
"window=':Qt Creator_Core::Internal::MainWindow' "
|
"window=':Qt Creator_Core::Internal::MainWindow' "
|
||||||
"leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>'"
|
"leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>'"
|
||||||
@@ -231,27 +214,13 @@ def __configureCustomExecutable__(projectName, port, mkspec, qmakeVersion):
|
|||||||
"Failed to find '%s'" % startAUT)
|
"Failed to find '%s'" % startAUT)
|
||||||
return False
|
return False
|
||||||
progressBarWait()
|
progressBarWait()
|
||||||
addButton = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' "
|
|
||||||
"type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' "
|
|
||||||
"visible='1'} occurrence='2' text='Add' type='QPushButton' "
|
|
||||||
"unnamed='1' visible='1'}")
|
|
||||||
clickButton(addButton)
|
|
||||||
addMenu = addButton.menu()
|
|
||||||
activateItem(waitForObjectItem(addMenu, 'Custom Executable'))
|
|
||||||
exePathChooser = waitForObject(":Executable:_Utils::PathChooser", 2000)
|
|
||||||
exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit")
|
|
||||||
argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
|
|
||||||
"type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' "
|
|
||||||
"unnamed='1' visible='1'}")
|
|
||||||
wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' text='Working directory:' type='QLabel'} "
|
|
||||||
"type='Utils::PathChooser' unnamed='1' visible='1'}")
|
|
||||||
replaceEditorContent(exeLineEd, startAUT)
|
|
||||||
# the following is currently only configured for release builds (will be enhanced later)
|
# the following is currently only configured for release builds (will be enhanced later)
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
debOrRel = "release" + os.sep
|
debOrRel = "release" + os.sep
|
||||||
else:
|
else:
|
||||||
debOrRel = ""
|
debOrRel = ""
|
||||||
replaceEditorContent(argLineEd, "--verbose --port=%d %s%s" % (port, debOrRel, projectName))
|
args = "--verbose --port=%d %s%s" % (port, debOrRel, projectName)
|
||||||
|
__invokeAddCustomExecutable__(startAUT, args)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# function that retrieves a specific child object by its class
|
# function that retrieves a specific child object by its class
|
||||||
@@ -424,3 +393,25 @@ def __getSquishServer__():
|
|||||||
test.fatal("SQUISH_PREFIX isn't set - leaving test")
|
test.fatal("SQUISH_PREFIX isn't set - leaving test")
|
||||||
return None
|
return None
|
||||||
return os.path.abspath(squishSrv + "/bin/squishserver")
|
return os.path.abspath(squishSrv + "/bin/squishserver")
|
||||||
|
|
||||||
|
def __invokeAddCustomExecutable__(exe, args, workingDir=None):
|
||||||
|
addButton = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' "
|
||||||
|
"type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' "
|
||||||
|
"visible='1'} occurrence='2' text='Add' type='QPushButton' "
|
||||||
|
"unnamed='1' visible='1'}")
|
||||||
|
clickButton(addButton)
|
||||||
|
addMenu = addButton.menu()
|
||||||
|
activateItem(waitForObjectItem(addMenu, 'Custom Executable'))
|
||||||
|
exePathChooser = waitForObject(":Executable:_Utils::PathChooser")
|
||||||
|
exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit")
|
||||||
|
argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
|
||||||
|
"type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' "
|
||||||
|
"unnamed='1' visible='1'}")
|
||||||
|
wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
|
||||||
|
"text='Working directory:' type='QLabel'} "
|
||||||
|
"type='Utils::PathChooser' unnamed='1' visible='1'}")
|
||||||
|
wdLineEd = getChildByClass(wdPathChooser, "Utils::BaseValidatingLineEdit")
|
||||||
|
replaceEditorContent(exeLineEd, exe)
|
||||||
|
replaceEditorContent(argLineEd, args)
|
||||||
|
if workingDir:
|
||||||
|
replaceEditorContent(wdLineEd, workingDir)
|
||||||
|
Reference in New Issue
Block a user