aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2020-06-16 20:35:32 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2020-06-17 07:52:48 +0000
commit40f71f6e046caac55ac67da4577e9f56a1592514 (patch)
tree68fb13a54832fcf6ca2c86f735f9a4fa82ddf81b /tests
parent7ac0759dcb6c7e1b2b5a99ee73cbaec7d8014692 (diff)
baremetal: Add auto-test for cpp.systemIncludePaths property
This commit adds a blackbox auto-test which compiles an application using two include paths foo and bar. Tested for MCS51 architecture with IAR, KEIL, and SDCC toolchains. Change-Id: If68be8f120a0ef760f6ca5b3674dfd49f2cf8a7f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata-baremetal/system-include-paths/bar/bar.h6
-rw-r--r--tests/auto/blackbox/testdata-baremetal/system-include-paths/foo/foo.h6
-rw-r--r--tests/auto/blackbox/testdata-baremetal/system-include-paths/main.c7
-rw-r--r--tests/auto/blackbox/testdata-baremetal/system-include-paths/system-include-paths.qbs4
-rw-r--r--tests/auto/blackbox/tst_blackboxbaremetal.cpp6
-rw-r--r--tests/auto/blackbox/tst_blackboxbaremetal.h1
6 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-baremetal/system-include-paths/bar/bar.h b/tests/auto/blackbox/testdata-baremetal/system-include-paths/bar/bar.h
new file mode 100644
index 000000000..49ffa0b12
--- /dev/null
+++ b/tests/auto/blackbox/testdata-baremetal/system-include-paths/bar/bar.h
@@ -0,0 +1,6 @@
+#ifndef BAR_H
+#define BAR_H
+
+#define BAR_VALUE 1
+
+#endif // BAR_H
diff --git a/tests/auto/blackbox/testdata-baremetal/system-include-paths/foo/foo.h b/tests/auto/blackbox/testdata-baremetal/system-include-paths/foo/foo.h
new file mode 100644
index 000000000..dc510379d
--- /dev/null
+++ b/tests/auto/blackbox/testdata-baremetal/system-include-paths/foo/foo.h
@@ -0,0 +1,6 @@
+#ifndef FOO_H
+#define FOO_H
+
+#define FOO_VALUE 1
+
+#endif // FOO_H
diff --git a/tests/auto/blackbox/testdata-baremetal/system-include-paths/main.c b/tests/auto/blackbox/testdata-baremetal/system-include-paths/main.c
new file mode 100644
index 000000000..aabc97a0c
--- /dev/null
+++ b/tests/auto/blackbox/testdata-baremetal/system-include-paths/main.c
@@ -0,0 +1,7 @@
+#include <foo.h>
+#include <bar.h>
+
+int main(void)
+{
+ return FOO_VALUE - BAR_VALUE;
+}
diff --git a/tests/auto/blackbox/testdata-baremetal/system-include-paths/system-include-paths.qbs b/tests/auto/blackbox/testdata-baremetal/system-include-paths/system-include-paths.qbs
new file mode 100644
index 000000000..8e12807f2
--- /dev/null
+++ b/tests/auto/blackbox/testdata-baremetal/system-include-paths/system-include-paths.qbs
@@ -0,0 +1,4 @@
+CppApplication {
+ files: ["main.c"]
+ cpp.systemIncludePaths: ["foo", "bar"]
+}
diff --git a/tests/auto/blackbox/tst_blackboxbaremetal.cpp b/tests/auto/blackbox/tst_blackboxbaremetal.cpp
index 477758903..0a73c6003 100644
--- a/tests/auto/blackbox/tst_blackboxbaremetal.cpp
+++ b/tests/auto/blackbox/tst_blackboxbaremetal.cpp
@@ -57,4 +57,10 @@ void TestBlackboxBareMetal::userIncludePaths()
QCOMPARE(runQbs(), 0);
}
+void TestBlackboxBareMetal::systemIncludePaths()
+{
+ QDir::setCurrent(testDataDir + "/system-include-paths");
+ QCOMPARE(runQbs(), 0);
+}
+
QTEST_MAIN(TestBlackboxBareMetal)
diff --git a/tests/auto/blackbox/tst_blackboxbaremetal.h b/tests/auto/blackbox/tst_blackboxbaremetal.h
index 11907ecf7..4bd2c0b36 100644
--- a/tests/auto/blackbox/tst_blackboxbaremetal.h
+++ b/tests/auto/blackbox/tst_blackboxbaremetal.h
@@ -45,6 +45,7 @@ private slots:
void application();
void userIncludePaths();
+ void systemIncludePaths();
private: