diff options
author | Robert Loehning <robert.loehning@qt.io> | 2018-05-04 13:34:38 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2018-05-08 09:06:02 +0000 |
commit | 5a54a813d36b96ee927c9345aa244b995714797b (patch) | |
tree | d265dda7f0db7b40f57e281859555da8282e0d53 /tests | |
parent | 06c2e693015c01954038f7a85523eb5f226fccf6 (diff) |
Squish: Remove code for querying information about Qt
Task-number: QTCREATORBUG-20337
Change-Id: Ib99d3bb45297b766ac1797a2a364350d96ce0056
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/shared/classes.py | 5 | ||||
-rw-r--r-- | tests/system/shared/project_explorer.py | 33 | ||||
-rw-r--r-- | tests/system/suite_debugger/tst_simple_analyze/test.py | 2 |
3 files changed, 6 insertions, 34 deletions
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index c9a84e5c24..398928366e 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -118,11 +118,6 @@ class ViewConstants: return None return toolTip % (viewTab + 1) -class QtInformation: - QT_VERSION = 0 - QT_BINPATH = 1 - QT_LIBPATH = 2 - class LibType: SHARED = 0 STATIC = 1 diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py index c506690d70..1fcbf1bc21 100644 --- a/tests/system/shared/project_explorer.py +++ b/tests/system/shared/project_explorer.py @@ -157,16 +157,13 @@ def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=Fa qmakeCallLabel = waitForObject("{text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") - mkspec = __getMkspecFromQMakeCall__(str(qmakeCallLabel.text)) - qtVersion = getQtInformationByQMakeCall(qtDir, QtInformation.QT_VERSION) - qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH) - qtBinPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_BINPATH) + qtVersion = getQtInformationByQMakeCall(qtDir) if afterSwitchTo: if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE: switchViewTo(afterSwitchTo) else: test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo) - return qtVersion, mkspec, qtBinPath, qtLibPath + return qtVersion def getQtInformationForQmlProject(): fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton") @@ -240,20 +237,10 @@ def getExecutableAndTargetFromToolTip(toolTip): return None, target return exe.group(1).strip(), target -def __getMkspecFromQMakeCall__(qmakeCall): - 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 +# this function queries the version number from qmake # 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 -def getQtInformationByQMakeCall(qtDir, which): +def getQtInformationByQMakeCall(qtDir): qmake = os.path.join(qtDir, "bin", "qmake") if platform.system() in ('Microsoft', 'Windows'): qmake += ".exe" @@ -261,17 +248,7 @@ def getQtInformationByQMakeCall(qtDir, which): test.fatal("Given Qt directory does not exist or does not contain bin/qmake.", "Constructed path: '%s'" % qmake) return None - query = "" - 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() + return getOutputFromCmdline([qmake, "-query", "QT_VERSION"]).strip() def invokeContextMenuOnProject(projectName, menuItem): try: diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index c366d535bc..919672f667 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -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 # of differences between MSVC's and MinGW's Makefile (so clean before switching kits) 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) # explicitly build before start debugging for adding the executable as allowed program to WinFW invokeMenuItem("Build", "Rebuild All") |