Introduced common unit test .pri file
authorAki Koskinen <maemo@akikoskinen.info>
Sun, 21 Mar 2010 13:40:43 +0000 (15:40 +0200)
committerAki Koskinen <maemo@akikoskinen.info>
Sun, 21 Mar 2010 13:40:43 +0000 (15:40 +0200)
tests/stlhelpers4qt.h [deleted file]
tests/ut_common.pri [new file with mode: 0644]
tests/ut_gmocktest/ut_gmocktest.cpp
tests/ut_gmocktest/ut_gmocktest.pro
tests/ut_template/ut_template.pro
tests/util/stlhelpers4qt.h [new file with mode: 0644]

diff --git a/tests/stlhelpers4qt.h b/tests/stlhelpers4qt.h
deleted file mode 100644 (file)
index b3c297f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef STLHELPERS4QT_H
-#define STLHELPERS4QT_H
-
-#include <ostream>
-#include <QList>
-#include <QVariant>
-
-/**
- * Outputs the contents of a QList<QVariant> container to a std::ostream object.
- * @param stream the stream to output to
- * @param val the container that is put to the stream
- * @return the same stream that was passed as the parameter @a stream
- */
-std::ostream& operator<<(std::ostream& stream, const QList<QVariant> &val)
-{
-    bool first = true;
-
-    foreach (const QVariant &v, val) {
-        if (!first) {
-            stream << ", ";
-        }
-        stream << v.toString().toStdString();
-        first = false;
-    }
-    return stream;
-}
-
-#endif // STLHELPERS4QT_H
diff --git a/tests/ut_common.pri b/tests/ut_common.pri
new file mode 100644 (file)
index 0000000..d813d82
--- /dev/null
@@ -0,0 +1 @@
+INCLUDEPATH += ../util
index e307bd6..e756c8c 100644 (file)
@@ -5,7 +5,7 @@
 #include <gtest/gtest.h>
 
 #include <QSignalSpy>
-#include "../stlhelpers4qt.h"
+#include "stlhelpers4qt.h"
 
 using ::testing::AtLeast;
 
index 8ae82cf..8a516e3 100644 (file)
@@ -1,3 +1,5 @@
+include(../ut_common.pri)
+
 TARGET = ut_gmocktest
 QT += testlib
 QT -= gui
index 0e85b81..dd7ce43 100644 (file)
@@ -1,3 +1,5 @@
+include(../ut_common.pri)
+
 TARGET = ut_template
 QT += testlib
 QT -= gui
diff --git a/tests/util/stlhelpers4qt.h b/tests/util/stlhelpers4qt.h
new file mode 100644 (file)
index 0000000..b3c297f
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef STLHELPERS4QT_H
+#define STLHELPERS4QT_H
+
+#include <ostream>
+#include <QList>
+#include <QVariant>
+
+/**
+ * Outputs the contents of a QList<QVariant> container to a std::ostream object.
+ * @param stream the stream to output to
+ * @param val the container that is put to the stream
+ * @return the same stream that was passed as the parameter @a stream
+ */
+std::ostream& operator<<(std::ostream& stream, const QList<QVariant> &val)
+{
+    bool first = true;
+
+    foreach (const QVariant &v, val) {
+        if (!first) {
+            stream << ", ";
+        }
+        stream << v.toString().toStdString();
+        first = false;
+    }
+    return stream;
+}
+
+#endif // STLHELPERS4QT_H