forked from qt-creator/qt-creator
Squish: Remove code for querying information about Qt
Task-number: QTCREATORBUG-20337 Change-Id: Ib99d3bb45297b766ac1797a2a364350d96ce0056 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -118,11 +118,6 @@ class ViewConstants:
|
|||||||
return None
|
return None
|
||||||
return toolTip % (viewTab + 1)
|
return toolTip % (viewTab + 1)
|
||||||
|
|
||||||
class QtInformation:
|
|
||||||
QT_VERSION = 0
|
|
||||||
QT_BINPATH = 1
|
|
||||||
QT_LIBPATH = 2
|
|
||||||
|
|
||||||
class LibType:
|
class LibType:
|
||||||
SHARED = 0
|
SHARED = 0
|
||||||
STATIC = 1
|
STATIC = 1
|
||||||
|
@@ -157,16 +157,13 @@ def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=Fa
|
|||||||
|
|
||||||
qmakeCallLabel = waitForObject("{text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1' "
|
qmakeCallLabel = waitForObject("{text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1' "
|
||||||
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
mkspec = __getMkspecFromQMakeCall__(str(qmakeCallLabel.text))
|
qtVersion = getQtInformationByQMakeCall(qtDir)
|
||||||
qtVersion = getQtInformationByQMakeCall(qtDir, QtInformation.QT_VERSION)
|
|
||||||
qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH)
|
|
||||||
qtBinPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_BINPATH)
|
|
||||||
if afterSwitchTo:
|
if afterSwitchTo:
|
||||||
if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE:
|
if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE:
|
||||||
switchViewTo(afterSwitchTo)
|
switchViewTo(afterSwitchTo)
|
||||||
else:
|
else:
|
||||||
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, mkspec, qtBinPath, qtLibPath
|
return qtVersion
|
||||||
|
|
||||||
def getQtInformationForQmlProject():
|
def getQtInformationForQmlProject():
|
||||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||||
@@ -240,20 +237,10 @@ def getExecutableAndTargetFromToolTip(toolTip):
|
|||||||
return None, target
|
return None, target
|
||||||
return exe.group(1).strip(), target
|
return exe.group(1).strip(), target
|
||||||
|
|
||||||
def __getMkspecFromQMakeCall__(qmakeCall):
|
# this function queries the version number from qmake
|
||||||
qCall = qmakeCall.split("</b>")[1].strip()
|
|
||||||
tmp = qCall.split()
|
|
||||||
for i in range(len(tmp)):
|
|
||||||
if tmp[i] == '-spec' and i + 1 < len(tmp):
|
|
||||||
return tmp[i + 1]
|
|
||||||
test.fatal("Couldn't get mkspec from qmake call '%s'" % qmakeCall)
|
|
||||||
return None
|
|
||||||
|
|
||||||
# this function queries information from qmake
|
|
||||||
# param qtDir set this to a path that holds a valid Qt
|
# param qtDir set this to a path that holds a valid Qt
|
||||||
# param which set this to one of the QtInformation "constants"
|
|
||||||
# the function will return the wanted information or None if something went wrong
|
# the function will return the wanted information or None if something went wrong
|
||||||
def getQtInformationByQMakeCall(qtDir, which):
|
def getQtInformationByQMakeCall(qtDir):
|
||||||
qmake = os.path.join(qtDir, "bin", "qmake")
|
qmake = os.path.join(qtDir, "bin", "qmake")
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
qmake += ".exe"
|
qmake += ".exe"
|
||||||
@@ -261,17 +248,7 @@ def getQtInformationByQMakeCall(qtDir, which):
|
|||||||
test.fatal("Given Qt directory does not exist or does not contain bin/qmake.",
|
test.fatal("Given Qt directory does not exist or does not contain bin/qmake.",
|
||||||
"Constructed path: '%s'" % qmake)
|
"Constructed path: '%s'" % qmake)
|
||||||
return None
|
return None
|
||||||
query = ""
|
return getOutputFromCmdline([qmake, "-query", "QT_VERSION"]).strip()
|
||||||
if which == QtInformation.QT_VERSION:
|
|
||||||
query = "QT_VERSION"
|
|
||||||
elif which == QtInformation.QT_BINPATH:
|
|
||||||
query = "QT_INSTALL_BINS"
|
|
||||||
elif which == QtInformation.QT_LIBPATH:
|
|
||||||
query = "QT_INSTALL_LIBS"
|
|
||||||
else:
|
|
||||||
test.fatal("You're trying to fetch an unknown information (%s)" % which)
|
|
||||||
return None
|
|
||||||
return getOutputFromCmdline([qmake, "-query", query]).strip()
|
|
||||||
|
|
||||||
def invokeContextMenuOnProject(projectName, menuItem):
|
def invokeContextMenuOnProject(projectName, menuItem):
|
||||||
try:
|
try:
|
||||||
|
@@ -67,7 +67,7 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
|
|||||||
# switching from MSVC to MinGW build will fail on the clean step of 'Rebuild All' because
|
# switching from MSVC to MinGW build will fail on the clean step of 'Rebuild All' because
|
||||||
# of differences between MSVC's and MinGW's Makefile (so clean before switching kits)
|
# of differences between MSVC's and MinGW's Makefile (so clean before switching kits)
|
||||||
invokeMenuItem('Build', 'Clean Project "%s"' % projectName)
|
invokeMenuItem('Build', 'Clean Project "%s"' % projectName)
|
||||||
qtVersion = verifyBuildConfig(targetCount, kit, config, True, True, True)[0]
|
qtVersion = verifyBuildConfig(targetCount, kit, config, True, True, True)
|
||||||
test.log("Selected kit using Qt %s" % qtVersion)
|
test.log("Selected kit using Qt %s" % qtVersion)
|
||||||
# explicitly build before start debugging for adding the executable as allowed program to WinFW
|
# explicitly build before start debugging for adding the executable as allowed program to WinFW
|
||||||
invokeMenuItem("Build", "Rebuild All")
|
invokeMenuItem("Build", "Rebuild All")
|
||||||
|
Reference in New Issue
Block a user