aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-07-12 17:59:29 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-07-13 07:49:27 +0000
commit75f2374ab16efc9bf178e47d575e2a095953089a (patch)
treee798d4b31c14b3d87ca6b0d018d677240668f062 /tests
parent73abc60f00f2d48b39cf9e938ad85527e5efbdfc (diff)
Add XFAILing autotest for false positive in declaration checker
Change-Id: I7c8cfebd9d5ab0a97cfac8f2775638123c54b667 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/per-group-define-in-export-item/main.cpp3
-rw-r--r--tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs18
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp9
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/per-group-define-in-export-item/main.cpp b/tests/auto/blackbox/testdata/per-group-define-in-export-item/main.cpp
new file mode 100644
index 000000000..f9cd52e85
--- /dev/null
+++ b/tests/auto/blackbox/testdata/per-group-define-in-export-item/main.cpp
@@ -0,0 +1,3 @@
+#ifdef MAIN
+int main() {}
+#endif
diff --git a/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs b/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs
new file mode 100644
index 000000000..514de7ecb
--- /dev/null
+++ b/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs
@@ -0,0 +1,18 @@
+import qbs
+
+Project {
+ Product {
+ name: "dep"
+ Export {
+ Depends { name: "cpp" }
+ Group {
+ cpp.defines: ["MAIN"]
+ files: ["main.cpp"]
+ }
+ }
+ }
+ Application {
+ name: "app"
+ Depends { name: "dep" }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 3acf4ee37..209634931 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1836,6 +1836,15 @@ void TestBlackbox::pchChangeTracking()
QVERIFY2(!m_qbsStdout.contains("precompiling pch.h (cpp)"), m_qbsStdout.constData());
}
+void TestBlackbox::perGroupDefineInExportItem()
+{
+ QDir::setCurrent(testDataDir + "/per-group-define-in-export-item");
+ QbsRunParameters params;
+ params.expectFailure = true;
+ QEXPECT_FAIL(0, "Declaration check is overeager", Abort);
+ QCOMPARE(runQbs(params), 0);
+}
+
void TestBlackbox::pkgConfigProbe()
{
const QString exe = findExecutable(QStringList() << "pkg-config");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 4ae313946..dc55f5307 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -126,6 +126,7 @@ private slots:
void outputArtifactAutoTagging();
void overrideProjectProperties();
void pchChangeTracking();
+ void perGroupDefineInExportItem();
void pkgConfigProbe();
void pkgConfigProbe_data();
void pkgConfigProbeSysroot();