aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-03-18 10:35:50 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2013-03-18 11:10:36 +0100
commite0d8d7178734c888c4e5938a6047210c50871c59 (patch)
tree473c65dd0b7073ae1b0fae7d0038d4a782cc8810 /tests/auto
parente0b913e9b827c5be6a9c525e6ac2942e157ee8ec (diff)
qbs project files: Add support for auto tests.
Change-Id: I02715cda889f9f271a4372b0dec70645674f8843 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/autotest.qbs20
-rw-r--r--tests/auto/blackbox/blackbox.qbs7
-rw-r--r--tests/auto/buildgraph/buildgraph.qbs6
-rw-r--r--tests/auto/cmdlineparser/cmdlineparser.qbs26
-rw-r--r--tests/auto/cmdlineparser/tst_cmdlineparser.cpp6
-rw-r--r--tests/auto/language/language.qbs6
-rw-r--r--tests/auto/tools/tools.qbs6
7 files changed, 74 insertions, 3 deletions
diff --git a/tests/auto/autotest.qbs b/tests/auto/autotest.qbs
new file mode 100644
index 000000000..0c3bffb82
--- /dev/null
+++ b/tests/auto/autotest.qbs
@@ -0,0 +1,20 @@
+import qbs
+
+CppApplication {
+ type: "application"
+ name: "tst_" + testName
+ Depends { name: "Qt.test" }
+ Depends { name: "qbscore" }
+ cpp.includePaths: path + "/../../src"
+ destinationDirectory: "bin"
+ Group {
+ name: "logging"
+ prefix: path + "/../../src/app/shared/logging/"
+ files: [
+ "coloredoutput.cpp",
+ "coloredoutput.h",
+ "consolelogger.cpp",
+ "consolelogger.h"
+ ]
+ }
+}
diff --git a/tests/auto/blackbox/blackbox.qbs b/tests/auto/blackbox/blackbox.qbs
new file mode 100644
index 000000000..f7c28939b
--- /dev/null
+++ b/tests/auto/blackbox/blackbox.qbs
@@ -0,0 +1,7 @@
+import "../autotest.qbs" as AutoTest
+
+AutoTest {
+ testName: "blackbox"
+ files: ["tst_blackbox.h", "tst_blackbox.cpp"]
+ cpp.defines: base.concat(['SRCDIR="' + path + '"'])
+}
diff --git a/tests/auto/buildgraph/buildgraph.qbs b/tests/auto/buildgraph/buildgraph.qbs
new file mode 100644
index 000000000..69ef0ddde
--- /dev/null
+++ b/tests/auto/buildgraph/buildgraph.qbs
@@ -0,0 +1,6 @@
+import "../autotest.qbs" as AutoTest
+
+AutoTest {
+ testName: "buildgraph"
+ files: "tst_buildgraph.cpp"
+}
diff --git a/tests/auto/cmdlineparser/cmdlineparser.qbs b/tests/auto/cmdlineparser/cmdlineparser.qbs
new file mode 100644
index 000000000..6d61dddb3
--- /dev/null
+++ b/tests/auto/cmdlineparser/cmdlineparser.qbs
@@ -0,0 +1,26 @@
+import "../autotest.qbs" as AutoTest
+
+AutoTest {
+ testName: "cmdlineparser"
+ files: ["tst_cmdlineparser.cpp", "../../../src/app/qbs/qbstool.cpp"]
+ cpp.defines: base.concat(['SRCDIR="' + path + '"', "QBS_VERSION=\"" + project.version + "\""])
+
+ // TODO: Make parser a static library?
+ Group {
+ name: "parser"
+ prefix: "../../../src/app/qbs/parser/"
+ files: [
+ "command.cpp",
+ "command.h",
+ "commandlineoption.cpp",
+ "commandlineoption.h",
+ "commandlineoptionpool.cpp",
+ "commandlineoptionpool.h",
+ "commandlineparser.cpp",
+ "commandlineparser.h",
+ "commandpool.cpp",
+ "commandpool.h",
+ "commandtype.h",
+ ]
+ }
+}
diff --git a/tests/auto/cmdlineparser/tst_cmdlineparser.cpp b/tests/auto/cmdlineparser/tst_cmdlineparser.cpp
index 51a4c18f1..af029fce5 100644
--- a/tests/auto/cmdlineparser/tst_cmdlineparser.cpp
+++ b/tests/auto/cmdlineparser/tst_cmdlineparser.cpp
@@ -114,9 +114,9 @@ private slots:
void testProjectFileLookup()
{
const QString srcDir = QLatin1String(SRCDIR);
- const QString noProjectsDir = srcDir + QLatin1String("data/dirwithnoprojects");
- const QString oneProjectDir = srcDir + QLatin1String("data/dirwithoneproject");
- const QString multiProjectsDir = srcDir + QLatin1String("data/dirwithmultipleprojects");
+ const QString noProjectsDir = srcDir + QLatin1String("/data/dirwithnoprojects");
+ const QString oneProjectDir = srcDir + QLatin1String("/data/dirwithoneproject");
+ const QString multiProjectsDir = srcDir + QLatin1String("/data/dirwithmultipleprojects");
QVERIFY(QDir(noProjectsDir).exists() && QDir(oneProjectDir).exists()
&& QDir(multiProjectsDir).exists());
CommandLineParser parser;
diff --git a/tests/auto/language/language.qbs b/tests/auto/language/language.qbs
new file mode 100644
index 000000000..af081b741
--- /dev/null
+++ b/tests/auto/language/language.qbs
@@ -0,0 +1,6 @@
+import "../autotest.qbs" as AutoTest
+
+AutoTest {
+ testName: "language"
+ files: "tst_language.cpp"
+}
diff --git a/tests/auto/tools/tools.qbs b/tests/auto/tools/tools.qbs
new file mode 100644
index 000000000..e0cb6c785
--- /dev/null
+++ b/tests/auto/tools/tools.qbs
@@ -0,0 +1,6 @@
+import "../autotest.qbs" as AutoTest
+
+AutoTest {
+ testName: "tools"
+ files: ["tst_tools.cpp"]
+}