diff --git a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml
index 12a3998034c..1a46caa099c 100644
--- a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml
+++ b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml
@@ -68,7 +68,9 @@
{1b25f20a-d584-4fb7-85b3-74dd15b82f6f}
Desktop Device
Desktop
-
+
+ SQUISH_ENV_MODIFICATION
+
{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17}
diff --git a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml
index 2b74b28f266..81822bd1fab 100644
--- a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml
+++ b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml
@@ -44,7 +44,7 @@
PATH
0
- SQUISH_MSVC2017_PATH
+ SQUISH_MSVC2017_64_PATH
MSVC2017 (amd64)
@@ -59,6 +59,13 @@
x86-windows-msvc2015-pe-32bit
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat
x86
+
+
+ PATH
+ 0
+ SQUISH_MSVC2017_32_PATH
+
+
true
Microsoft Visual C++ Compiler 14.0 (x86)
ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17}
@@ -72,6 +79,13 @@
x86-windows-msvc2015-pe-32bit
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat
x86
+
+
+ PATH
+ 0
+ SQUISH_MSVC2017_32_PATH
+
+
true
Microsoft Visual C++ Compiler 14.0 (x86)
ProjectExplorer.ToolChain.Msvc:{ed856706-2a9d-4745-9d85-4e322b6f91d4}
@@ -89,7 +103,7 @@
PATH
0
- SQUISH_MSVC2017_PATH
+ SQUISH_MSVC2017_64_PATH
MSVC2017 (amd64)
@@ -108,7 +122,7 @@
PATH
0
- SQUISH_MSVC2019_PATH
+ SQUISH_MSVC2019_64_PATH
MSVC2019 (amd64)
@@ -127,7 +141,7 @@
PATH
0
- SQUISH_MSVC2019_PATH
+ SQUISH_MSVC2019_64_PATH
MSVC2019 (amd64)
diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py
index 9fd54aec0e5..f82f3c6e09d 100644
--- a/tests/system/shared/qtcreator.py
+++ b/tests/system/shared/qtcreator.py
@@ -237,18 +237,20 @@ def substituteCdb(settingsDir):
test.log("Injected architecture '%s' and bitness '%s' in cdb path..." % (architecture, bitness))
-def substituteMsvcPaths(settingsDir, version):
+def substituteMsvcPaths(settingsDir, version, targetBitness=64):
if not version in ['2017', '2019']:
test.fatal('Unexpected MSVC version - "%s" not implemented yet.' % version)
return
+ hostArch = "Hostx64" if targetBitness == 64 else "Hostx86"
+ targetArch = "x64" if targetBitness == 64 else "x86"
for msvcFlavor in ["Community", "BuildTools"]:
try:
msvcPath = os.path.join("C:\\Program Files (x86)", "Microsoft Visual Studio",
version, msvcFlavor, "VC", "Tools", "MSVC")
- msvcPath = os.path.join(msvcPath, os.listdir(msvcPath)[0], "bin", "HostX64", "x64")
+ msvcPath = os.path.join(msvcPath, os.listdir(msvcPath)[0], "bin", hostArch, targetArch)
__substitute__(os.path.join(settingsDir, "QtProject", 'qtcreator', 'toolchains.xml'),
- "SQUISH_MSVC%s_PATH" % version, msvcPath)
+ "SQUISH_MSVC%s_%d_PATH" % (version, targetBitness), msvcPath)
return
except:
continue
@@ -256,6 +258,26 @@ def substituteMsvcPaths(settingsDir, version):
"Please make sure that MSVC%s is installed correctly." % version)
+def prependWindowsKit(settingsDir, targetBitness=64):
+ targetArch = "x64" if targetBitness == 64 else "x86"
+ profilesPath = os.path.join(settingsDir, 'QtProject', 'qtcreator', 'profiles.xml')
+ winkits = os.path.join("C:\\Program Files (x86)", "Windows Kits", "10")
+ if not os.path.exists(winkits):
+ __substitute__(profilesPath, "SQUISH_ENV_MODIFICATION", "")
+ return
+ possibleVersions = os.listdir(os.path.join(winkits, 'bin'))
+ possibleVersions.reverse() # prefer higher versions
+ for version in possibleVersions:
+ if not version.startswith("10"):
+ continue
+ toolsPath = os.path.join(winkits, 'bin', version, targetArch)
+ if os.path.exists(os.path.join(toolsPath, 'rc.exe')):
+ __substitute__(profilesPath, "SQUISH_ENV_MODIFICATION", "PATH=+%s" % toolsPath)
+ return
+ test.warning("Windows Kit path could not be added, some tests mail fail.")
+ __substitute__(profilesPath, "SQUISH_ENV_MODIFICATION", "")
+
+
def __guessABI__(supportedABIs, use64Bit):
if platform.system() == 'Linux':
supportedABIs = filter(lambda x: 'linux' in x, supportedABIs)
@@ -350,8 +372,10 @@ def copySettingsToTmpDir(destination=None, omitFiles=[]):
substituteDefaultCompiler(tmpSettingsDir)
elif platform.system() in ('Windows', 'Microsoft'):
substituteCdb(tmpSettingsDir)
- substituteMsvcPaths(tmpSettingsDir, '2017')
- substituteMsvcPaths(tmpSettingsDir, '2019')
+ substituteMsvcPaths(tmpSettingsDir, '2017', 64)
+ substituteMsvcPaths(tmpSettingsDir, '2017', 32)
+ substituteMsvcPaths(tmpSettingsDir, '2019', 64)
+ prependWindowsKit(tmpSettingsDir, 32)
substituteOnlineInstallerPath(tmpSettingsDir)
substituteUnchosenTargetABIs(tmpSettingsDir)
SettingsPath = ['-settingspath', '"%s"' % tmpSettingsDir]