From fed37117f456600bb29d0cd3df6f1ababdda6404 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 3 Jul 2018 16:22:34 +0200 Subject: Cover dependency parameter change tracking in autotest Change-Id: I180feccc60857a5431e1c55354e478824f62b6fe Reviewed-by: Joerg Bornemann --- .../testdata/plugin-dependency/plugin-dependency.qbs | 4 ++-- tests/auto/blackbox/tst_blackbox.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs index 3ae2f3c9a..f003a71cb 100644 --- a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs +++ b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs @@ -28,7 +28,7 @@ Project { Depends { name: "cpp" } Export { Parameters { - cpp.link: false + cpp.link: false // marker 1 } } } @@ -57,7 +57,7 @@ Project { name: "helper1" files: ["helper1.cpp"] Depends { name: "cpp" } - Depends { name: "helper2"; cpp.link: false } + Depends { name: "helper2"; cpp.link: false /* marker 2 */ } Export { Depends { name: "cpp" } Depends { name: "helper2"; cpp.link: false } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 8c8c0107e..64377dab8 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2651,6 +2651,24 @@ void TestBlackbox::pluginDependency() QVERIFY(!output.contains("plugin2")); QVERIFY(!output.contains("helper2")); + // Test change tracking for parameter in Parameters item. + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("plugin-dependency.qbs", "false // marker 1", "true"); + QCOMPARE(runQbs(QStringList{"-p", "plugin2"}), 0); + QVERIFY2(!m_qbsStdout.contains("linking"), m_qbsStdout.constData()); + QCOMPARE(runQbs(QStringList{"--command-echo-mode", "command-line"}), 0); + output = m_qbsStdout + '\n' + m_qbsStderr; + QVERIFY2(!output.contains("plugin1"), output.constData()); + QVERIFY2(output.contains("plugin2"), output.constData()); + QVERIFY2(!output.contains("helper2"), output.constData()); + + // Test change tracking for parameter in Depends item. + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("plugin-dependency.qbs", "false /* marker 2 */", "true"); + QCOMPARE(runQbs(QStringList{"-p", "helper1", "--command-echo-mode", "command-line"}), 0); + output = m_qbsStdout + '\n' + m_qbsStderr; + QVERIFY2(output.contains("helper2"), output.constData()); + // Check that the build dependency still works. QCOMPARE(runQbs(QStringLiteral("clean")), 0); QCOMPARE(runQbs(QStringList{"--products", "myapp", "--command-echo-mode", "command-line"}), 0); -- cgit v1.2.3