diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-12-08 16:16:11 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2016-12-09 19:17:20 +0000 |
commit | babbf2156579e6e0bbdac973aa5fc8c30d00b806 (patch) | |
tree | 6b928ea94a30ddd059e29f3eb4bf3c43725cec4f /tests | |
parent | 64e336b7af5b863de7e8108448f9103706786714 (diff) |
Fix some issues in the WiX module causing the autotest to fail
This allows qbs.architecture to be undefined for WiX, in which case the
WiX default architecture of x86 will be used. The autotest would fail if
there was no architecture set in the profile (which is allowed).
This also corrects the registry key name for finding WiX, leading to
incorrect autotest failures if WiX tools were in not in the PATH or
WiX properties were not set in a profile.
Lastly, this fixes a wrong concatenation of product.buildDirectory and
improves the output and error reporting for the autotest.
Change-Id: I227924b681131c13fcb09d2d5010b372ff44b241
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/testdata/wix/WiXInstallers.qbs | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs b/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs index 3e7facd7d..2c4c0b3c1 100644 --- a/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs +++ b/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs @@ -4,7 +4,7 @@ import qbs.FileInfo Project { WindowsInstallerPackage { name: "QbsSetup" - targetName: "qbs-" + qbs.architecture + targetName: "qbs" files: ["QbsSetup.wxs", "ExampleScript.bat"] wix.defines: ["scriptName=ExampleScript.bat"] wix.extensions: ["WixBalExtension", "WixUIExtension"] @@ -23,6 +23,7 @@ Project { name: "QbsBootstrapper" targetName: "qbs-setup-" + qbs.architecture files: ["QbsBootstrapper.wxs"] + qbs.architecture: original || "x86" } WindowsInstallerPackage { @@ -30,5 +31,6 @@ Project { files: ["QbsSetup.wxs", "Qt.wxs", "de.wxl"] wix.defines: ["scriptName=ExampleScript.bat"] wix.cultures: [] + qbs.architecture: original || "x86" } } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 6577ebbc4..7453944c6 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -3849,8 +3849,8 @@ static bool haveWiX(const Profile &profile) } QStringList regKeys; - regKeys << QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows Installer XML") - << QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Installer XML"); + regKeys << QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows Installer XML\\") + << QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Installer XML\\"); QStringList paths = QProcessEnvironment::systemEnvironment().value("PATH") .split(HostOsInfo::pathListSeparator(), QString::SkipEmptyParts); @@ -3887,20 +3887,22 @@ void TestBlackbox::wix() return; } - const QByteArray arch = profile.value("qbs.architecture").toString().toLatin1(); + QByteArray arch = profile.value("qbs.architecture").toString().toLatin1(); + if (arch.isEmpty()) + arch = QByteArrayLiteral("x86"); QDir::setCurrent(testDataDir + "/wix"); QbsRunParameters params; if (!HostOsInfo::isWindowsHost()) params.arguments << "qbs.targetOS:windows"; QCOMPARE(runQbs(params), 0); - QVERIFY(m_qbsStdout.contains("compiling QbsSetup.wxs")); - QVERIFY(m_qbsStdout.contains("linking qbs-" + arch + ".msi")); - QVERIFY(regularFileExists(relativeProductBuildDir("QbsSetup") + "/qbs-" + arch + ".msi")); + QVERIFY2(m_qbsStdout.contains("compiling QbsSetup.wxs"), m_qbsStdout); + QVERIFY2(m_qbsStdout.contains("linking qbs.msi"), m_qbsStdout); + QVERIFY(regularFileExists(relativeProductBuildDir("QbsSetup") + "/qbs.msi")); if (HostOsInfo::isWindowsHost()) { - QVERIFY(m_qbsStdout.contains("compiling QbsBootstrapper.wxs")); - QVERIFY(m_qbsStdout.contains("linking qbs-setup-" + arch + ".exe")); + QVERIFY2(m_qbsStdout.contains("compiling QbsBootstrapper.wxs"), m_qbsStdout); + QVERIFY2(m_qbsStdout.contains("linking qbs-setup-" + arch + ".exe"), m_qbsStdout); QVERIFY(regularFileExists(relativeProductBuildDir("QbsBootstrapper") + "/qbs-setup-" + arch + ".exe")); } |