diff --git a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml index b95c78667d9..a5d80d7dcbf 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml @@ -40,7 +40,13 @@ x86-windows-msvc2017-pe-64bit C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat amd64 - false + + + PATH + 0 + SQUISH_MSVC2017_PATH + + MSVC2017 (amd64) ProjectExplorer.ToolChain.Msvc:{ce3a8004-e9ae-46f2-b62d-d7daf69435ca} 1 @@ -79,7 +85,13 @@ x86-windows-msvc2017-pe-64bit C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat amd64 - false + + + PATH + 0 + SQUISH_MSVC2017_PATH + + MSVC2017 (amd64) ProjectExplorer.ToolChain.Msvc:{3df7c776-a480-4a04-9099-6c75adac2dca} 2 diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 984d3700ccf..e9d2e18cfc6 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -231,6 +231,23 @@ def substituteCdb(settingsDir): __substitute__(debuggers, "SQUISH_DEBUGGER_BITNESS", bitness) test.log("Injected architecture '%s' and bitness '%s' in cdb path..." % (architecture, bitness)) + +def substituteMsvcPaths(settingsDir): + for msvcFlavor in ["Community", "BuildTools"]: + try: + msvc2017Path = os.path.join("C:\\Program Files (x86)", "Microsoft Visual Studio", + "2017", msvcFlavor, "VC", "Tools", "MSVC") + msvc2017Path = os.path.join(msvc2017Path, os.listdir(msvc2017Path)[0], "bin", + "HostX64", "x64") + __substitute__(os.path.join(settingsDir, "QtProject", 'qtcreator', 'toolchains.xml'), + "SQUISH_MSVC2017_PATH", msvc2017Path) + return + except: + continue + test.warning("PATH variable for MSVC2017 could not be set, some tests will fail.", + "Please make sure that MSVC2017 is installed correctly.") + + def __guessABI__(supportedABIs, use64Bit): if platform.system() == 'Linux': supportedABIs = filter(lambda x: 'linux' in x, supportedABIs) @@ -325,6 +342,7 @@ def copySettingsToTmpDir(destination=None, omitFiles=[]): substituteDefaultCompiler(tmpSettingsDir) elif platform.system() in ('Windows', 'Microsoft'): substituteCdb(tmpSettingsDir) + substituteMsvcPaths(tmpSettingsDir) substituteUnchosenTargetABIs(tmpSettingsDir) SettingsPath = ['-settingspath', '"%s"' % tmpSettingsDir]