aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-08-05 11:14:26 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-08-06 11:27:03 +0200
commitfed87ed2e20632bc694c394cf44a30186f286cec (patch)
tree88f7093b86f48e3bb3fd3b658d88a7bea7128273 /tests
parent902fb4b96a60d947bb6fd5ee5aa4bdb4f30ee0cb (diff)
Add autotest for QBS-559.
This bug was fixed somewhat accidentally, so make sure it can't creep back in. Task-number: QBS-559 Change-Id: I3f85676f77cbc50b67f226810137860a7733fc6b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/new-output-artifact-in-dependency/lib.cpp1
-rw-r--r--tests/auto/blackbox/testdata/new-output-artifact-in-dependency/main.cpp6
-rw-r--r--tests/auto/blackbox/testdata/new-output-artifact-in-dependency/project.qbs15
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp22
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
5 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/lib.cpp b/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/lib.cpp
new file mode 100644
index 000000000..56757a701
--- /dev/null
+++ b/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/lib.cpp
@@ -0,0 +1 @@
+void f() {}
diff --git a/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/main.cpp b/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/main.cpp
new file mode 100644
index 000000000..b44adf42f
--- /dev/null
+++ b/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/main.cpp
@@ -0,0 +1,6 @@
+//void f();
+
+int main()
+{
+// f();
+}
diff --git a/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/project.qbs b/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/project.qbs
new file mode 100644
index 000000000..1e324fd89
--- /dev/null
+++ b/tests/auto/blackbox/testdata/new-output-artifact-in-dependency/project.qbs
@@ -0,0 +1,15 @@
+import qbs
+
+Project {
+ DynamicLibrary {
+ //Depends { name: "cpp" }
+ name: "lib"
+ files: "lib.cpp"
+ }
+
+ CppApplication {
+ name: "app"
+ files: "main.cpp"
+ Depends { name: "lib" }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 1da1def94..7c5ce29f0 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1823,6 +1823,28 @@ void TestBlackbox::mocCppIncluded()
QCOMPARE(runQbs(), 0);
}
+void TestBlackbox::newOutputArtifactInDependency()
+{
+ QDir::setCurrent(testDataDir + "/new-output-artifact-in-dependency");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY(m_qbsStdout.contains("linking app"));
+ const QByteArray linkingLibString = QByteArray("linking ")
+ + HostOsInfo::dynamicLibraryName("lib").toLatin1();
+ QVERIFY(!m_qbsStdout.contains(linkingLibString));
+
+ waitForNewTimestamp();
+ QFile projectFile("project.qbs");
+ QVERIFY2(projectFile.open(QIODevice::ReadWrite), qPrintable(projectFile.errorString()));
+ QByteArray contents = projectFile.readAll();
+ contents.replace("//Depends", "Depends");
+ projectFile.resize(0);
+ projectFile.write(contents);
+ projectFile.close();
+ QCOMPARE(runQbs(), 0);
+ QVERIFY(m_qbsStdout.contains("linking app"));
+ QVERIFY(m_qbsStdout.contains(linkingLibString));
+}
+
void TestBlackbox::newPatternMatch()
{
QDir::setCurrent(testDataDir + "/new-pattern-match");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 6b63343ef..066d46f5b 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -127,6 +127,7 @@ private slots:
void jsExtensionsTextFile();
void inheritQbsSearchPaths();
void mocCppIncluded();
+ void newOutputArtifactInDependency();
void newPatternMatch();
void nonBrokenFilesInBrokenProduct();
void objC();