From b9aca56026562b0fd6ff2fd2717e20666f40b98a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 20 Nov 2013 13:47:55 +0100 Subject: Take the qbs.install* properties into account when change tracking. These are currently ignored, because we only look for properties that were requested in prepare scripts. This does not typically happen for installation parameters, but since they end up in the output artifacts, changes to them still require re-setting up the respective build data. Task-number: QBS-359 Change-Id: I571cb4c1a02ea790ddde2f244136c6a0fd6fb627 Reviewed-by: Joerg Bornemann --- tests/auto/blackbox/tst_blackbox.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/auto/blackbox') diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 0700df165..c796d3e61 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1456,6 +1456,29 @@ void TestBlackbox::installedApp() + HostOsInfo::appendExecutableSuffix(QLatin1String("/usr/bin/installedApp")))); QVERIFY(!addedFile.exists()); + // Check whether changing install parameters on the product causes re-installation. + QFile projectFile("installed_artifact.qbs"); + QVERIFY(projectFile.open(QIODevice::ReadWrite)); + QByteArray content = projectFile.readAll(); + content.replace("qbs.installPrefix: \"/usr\"", "qbs.installPrefix: '/usr/local'"); + waitForNewTimestamp(); + projectFile.resize(0); + projectFile.write(content); + QVERIFY(projectFile.flush()); + QCOMPARE(runQbs(QbsRunParameters(QStringList("install"))), 0); + QVERIFY(QFile::exists(defaultInstallRoot + + HostOsInfo::appendExecutableSuffix(QLatin1String("/usr/local/bin/installedApp")))); + + // Check whether changing install parameters on the artifact causes re-installation. + content.replace("qbs.installDir: \"bin\"", "qbs.installDir: 'custom'"); + waitForNewTimestamp(); + projectFile.resize(0); + projectFile.write(content); + projectFile.close(); + QCOMPARE(runQbs(QbsRunParameters(QStringList("install"))), 0); + QVERIFY(QFile::exists(defaultInstallRoot + + HostOsInfo::appendExecutableSuffix(QLatin1String("/usr/local/custom/installedApp")))); + rmDirR(buildDir); QbsRunParameters params; params.arguments << "install" << "--no-build"; -- cgit v1.2.3