From 79758d0962c7465833bee6fb172f72b1cd1a3611 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 May 2014 14:37:23 +0200 Subject: extend TestBlackBox::fileDependencies narf.cpp includes awesome.h awesome.h includes magnificent.h awesome.h and magnificent.h are not listed in the project. Changing magnificent.h must trigger a rebuild of narf.cpp. Task-number: QBS-566 Change-Id: Ib2df45ac550951b550ce4ba0e7519268d9123eda Reviewed-by: Christian Kandeler --- .../auto/blackbox/testdata/fileDependencies/awesomelib/awesome.h | 3 ++- .../blackbox/testdata/fileDependencies/awesomelib/magnificent.h | 6 ++++++ tests/auto/blackbox/tst_blackbox.cpp | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/auto/blackbox/testdata/fileDependencies/awesomelib/magnificent.h (limited to 'tests/auto/blackbox') diff --git a/tests/auto/blackbox/testdata/fileDependencies/awesomelib/awesome.h b/tests/auto/blackbox/testdata/fileDependencies/awesomelib/awesome.h index 2c5d863ef..c98c806bb 100644 --- a/tests/auto/blackbox/testdata/fileDependencies/awesomelib/awesome.h +++ b/tests/auto/blackbox/testdata/fileDependencies/awesomelib/awesome.h @@ -1,7 +1,8 @@ #include +#include "magnificent.h" void doAwesomeStuff() { - printf("Just. Wow.\n"); + printf(magnificentMessage); } diff --git a/tests/auto/blackbox/testdata/fileDependencies/awesomelib/magnificent.h b/tests/auto/blackbox/testdata/fileDependencies/awesomelib/magnificent.h new file mode 100644 index 000000000..58fa39524 --- /dev/null +++ b/tests/auto/blackbox/testdata/fileDependencies/awesomelib/magnificent.h @@ -0,0 +1,6 @@ +#ifndef MAGNIFICENT_H +#define MAGNIFICENT_H + +const char magnificentMessage[] = "Just. Wow."; + +#endif // MAGNIFICENT_H diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 3ca70b7bd..51ac5121b 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1555,6 +1555,14 @@ void TestBlackbox::fileDependencies() QCOMPARE(runQbs(), 0); QVERIFY(m_qbsStdout.contains("compiling narf.cpp")); QVERIFY(!m_qbsStdout.contains("compiling zort.cpp")); + + // Incremental build with changed 2nd level file dependency. + waitForNewTimestamp(); + touch("awesomelib/magnificent.h"); + QCOMPARE(runQbs(), 0); + QEXPECT_FAIL("", "QBS-566", Abort); + QVERIFY(m_qbsStdout.contains("compiling narf.cpp")); + QVERIFY(!m_qbsStdout.contains("compiling zort.cpp")); } void TestBlackbox::jsExtensionsFile() -- cgit v1.2.3