Squish: Skip hook-into for mismatched Squish version

If the Squish version of the running AUT and the subprocess do
not match hooking into the subprocess fails because of using
different protocols.

Change-Id: I2e94c5ec2fbdc30aa39885bf1619df445c10f40b
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
Christian Stenger
2013-02-06 09:46:43 +01:00
parent 967db3f688
commit 18089cea55
3 changed files with 44 additions and 35 deletions

View File

@@ -219,6 +219,8 @@ def getChildByClass(parent, classToSearchFor, occurence=1):
# get the Squish path that is needed to successfully hook into the compiled app
def getSquishPath(mkspec, qmakev):
# assuming major and minor version will be enough
squishVersion = "%d.%d" % (squishinfo.major, squishinfo.minor)
qmakev = ".".join(qmakev.split(".")[0:2])
path = None
mapfile = os.environ.get("QT_SQUISH_MAPFILE")
@@ -228,9 +230,10 @@ def getSquishPath(mkspec, qmakev):
for line in file:
if line[0] == "#":
continue
tmp = pattern.split(line, 2)
if tmp[0].strip("'\"") == qmakev and tmp[1].strip("'\"") == mkspec:
path = os.path.expanduser(tmp[2].strip().strip("'\""))
tmp = pattern.split(line, 3)
if (tmp[0].strip("'\"") == squishVersion and tmp[1].strip("'\"") == qmakev
and tmp[2].strip("'\"") == mkspec):
path = os.path.expanduser(tmp[3].strip().strip("'\""))
break
file.close()
else:
@@ -242,12 +245,17 @@ def getSquishPath(mkspec, qmakev):
"See the README file how to use it.")
# try the test data fallback
mapData = testData.dataset(os.getcwd() + "/../../shared_data/qt_squish_mapping.tsv")
for row, record in enumerate(mapData):
if testData.field(record, "qtversion") == qmakev and testData.field(record, "mkspec") == mkspec:
for record in mapData:
if (testData.field(record, "squishversion") == squishVersion and
testData.field(record, "qtversion") == qmakev
and testData.field(record, "mkspec") == mkspec):
path = os.path.expanduser(testData.field(record, "path"))
break
if path == None or not os.path.exists(path):
test.warning("Path '%s' from fallback test data file does not exist!" % path,
if path == None:
test.warning("Haven't found suitable Squish version with matching Qt version and mkspec.",
"See the README file how to set up your environment.")
elif not os.path.exists(path):
test.warning("Squish path '%s' from fallback test data file does not exist!" % path,
"See the README file how to set up your environment.")
return None
return path