forked from qt-creator/qt-creator
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:
@@ -58,8 +58,9 @@ Using QT_SQUISH_MAPFILE variable
|
||||
|
||||
* create a simple text file (UTF-8 encoded) that follows this scheme:
|
||||
|
||||
QtVersion mkspec Path
|
||||
SquishVersion QtVersion mkspec Path
|
||||
|
||||
* SquishVersion: only major and minor number will be used (e.g. 4.1, 4.2)
|
||||
* QtVersion: only major and minor number will be used (e.g. 4.7, 4.8, 5.0)
|
||||
* mkspec: a string holding the mkspec as it appears inside QTSDK/mkspec (or inside Qt Creator)
|
||||
* Path: the path to the Squish directory that can be used with this combination of QtVersion and mkspec
|
||||
@@ -71,23 +72,23 @@ Using QT_SQUISH_MAPFILE variable
|
||||
|
||||
Example 1: (using single space, no quoting)
|
||||
|
||||
#qtversion mkspec path
|
||||
4.7<SP>win32-g++<SP>C:\Tools\Squish_MinGW
|
||||
4.7<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
|
||||
4.7<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
|
||||
4.8<SP>win32-g++<SP>C:\Tools\Squish_MinGW
|
||||
4.8<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
|
||||
4.8<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
|
||||
#squishversion qtversion mkspec path
|
||||
4.1<SP>4.7<SP>win32-g++<SP>C:\Tools\Squish_MinGW
|
||||
4.1<SP>4.7<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
|
||||
4.1<SP>4.7<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
|
||||
4.2<SP>4.8<SP>win32-g++<SP>C:\Tools\Squish_MinGW
|
||||
4.2<SP>4.8<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
|
||||
4.2<SP>4.8<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
|
||||
|
||||
Example 2: (using mixed whitespaces, some quoting)
|
||||
|
||||
#qtversion<TAB>mkspec<TAB><TAB><SP>path
|
||||
"4.7"<SP><TAB>win32-g++<TAB><TAB>'C:\Tools\Squish_MinGW'
|
||||
'4.7'<SP><TAB>'win32-msvc2008'<TAB>"C:\Tools\Squish_MSVC9"
|
||||
4.7<SP><SP><TAB>win32-msvc2010<TAB>C:\Tools\Squish_MSVC10
|
||||
"4.8"<SP><TAB>"win32-g++"<SP><SP><TAB>"C:\Tools\Squish_MinGW"
|
||||
'4.8'<SP><TAB>win32-msvc2008<SP><TAB>'C:\Tools\Squish_MSVC9'
|
||||
'4.8'<SP><TAB>win32-msvc2010<SP><TAB>C:\Tools\Squish_MSVC10
|
||||
#squishversion<SP>qtversion<TAB>mkspec<TAB><TAB><SP>path
|
||||
4.1<SP>"4.7"<SP><TAB>win32-g++<TAB><TAB>'C:\Tools\Squish_MinGW'
|
||||
4.1<SP>'4.7'<SP><TAB>'win32-msvc2008'<TAB>"C:\Tools\Squish_MSVC9"
|
||||
4.1<SP>4.7<SP><SP><TAB>win32-msvc2010<TAB>C:\Tools\Squish_MSVC10
|
||||
4.2<SP>"4.8"<SP><TAB>"win32-g++"<SP><SP><TAB>"C:\Tools\Squish_MinGW"
|
||||
4.2<SP>'4.8'<SP><TAB>win32-msvc2008<SP><TAB>'C:\Tools\Squish_MSVC9'
|
||||
4.2<SP>'4.8'<SP><TAB>win32-msvc2010<SP><TAB>C:\Tools\Squish_MSVC10
|
||||
|
||||
Explanation: <SP> = space, <TAB> = tabulator
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"qtversion" "mkspec" "path"
|
||||
"4.7" "win32-g++" "C:\QtSDK\src\creator-test-data\Squish_MinGW"
|
||||
"4.7" "win32-msvc2008" "C:\QtSDK\src\creator-test-data\Squish_MSVC9"
|
||||
"4.7" "win32-msvc-2010" "C:\QtSDK\src\creator-test-data\Squish_MSVC10"
|
||||
"4.7" "linux-g++" "~/QtSDK/src/creator-test-data/Squish_32"
|
||||
"4.7" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish_64"
|
||||
"4.7" "macx-g++" "~/QtSDK/src/creator-test-data/Squish_47x"
|
||||
"4.8" "win32-g++" "C:\QtSDK\src\creator-test-data\Squish_MinGW"
|
||||
"4.8" "win32-msvc2008" "C:\QtSDK\src\creator-test-data\Squish_MSVC9"
|
||||
"4.8" "win32-msvc-2010" "C:\QtSDK\src\creator-test-data\Squish_MSVC10"
|
||||
"4.8" "linux-g++" "~/QtSDK/src/creator-test-data/Squish_32"
|
||||
"4.8" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish_64"
|
||||
"4.8" "macx-g++" "~/QtSDK/src/creator-test-data/Squish_47x"
|
||||
"squishversion" "qtversion" "mkspec" "path"
|
||||
"4.1" "4.7" "win32-g++" "C:\QtSDK\src\creator-test-data\Squish_MinGW"
|
||||
"4.1" "4.7" "win32-msvc2008" "C:\QtSDK\src\creator-test-data\Squish_MSVC9"
|
||||
"4.1" "4.7" "win32-msvc-2010" "C:\QtSDK\src\creator-test-data\Squish_MSVC10"
|
||||
"4.1" "4.7" "linux-g++" "~/QtSDK/src/creator-test-data/Squish_32"
|
||||
"4.1" "4.7" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish_64"
|
||||
"4.1" "4.7" "macx-g++" "~/QtSDK/src/creator-test-data/Squish_47x"
|
||||
"4.1" "4.8" "win32-g++" "C:\QtSDK\src\creator-test-data\Squish_MinGW"
|
||||
"4.1" "4.8" "win32-msvc2008" "C:\QtSDK\src\creator-test-data\Squish_MSVC9"
|
||||
"4.1" "4.8" "win32-msvc-2010" "C:\QtSDK\src\creator-test-data\Squish_MSVC10"
|
||||
"4.1" "4.8" "linux-g++" "~/QtSDK/src/creator-test-data/Squish_32"
|
||||
"4.1" "4.8" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish_64"
|
||||
"4.1" "4.8" "macx-g++" "~/QtSDK/src/creator-test-data/Squish_47x"
|
||||
|
||||
|
Reference in New Issue
Block a user