diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-03 16:22:34 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-04 10:47:13 +0000 |
commit | fed37117f456600bb29d0cd3df6f1ababdda6404 (patch) | |
tree | cd87898a5f5035331ab586300ac31d7f96115141 | |
parent | 6b0dfb2c3a185bdd12437e0bedcca7dd6ceba9b2 (diff) | |
download | qbs-fed37117f456600bb29d0cd3df6f1ababdda6404.tar.gz |
Cover dependency parameter change tracking in autotest
Change-Id: I180feccc60857a5431e1c55354e478824f62b6fe
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs | 4 | ||||
-rw-r--r-- | 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); |