Removed spam.
authorJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Mon, 29 Mar 2010 09:56:32 +0000 (12:56 +0300)
committerJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Mon, 29 Mar 2010 09:56:32 +0000 (12:56 +0300)
scripts/master_test_script.sh [new file with mode: 0755]
tests/testGPS/testGPS.pro [new file with mode: 0644]
tests/testGPS/testgps.cpp [new file with mode: 0755]
tests/testPHP/testPHP.pro [new file with mode: 0644]
tests/testPHP/testphp.cpp [new file with mode: 0755]

diff --git a/scripts/master_test_script.sh b/scripts/master_test_script.sh
new file mode 100755 (executable)
index 0000000..10df1b4
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+##########################################################
+# This script is executed from /scripts directory        #
+# in situare project folder                              #
+##########################################################
+clear
+echo "This is the master script for building and executing all automatic unit test."
+echo "As a final step, it creates summary report from all tests executed."
+##########################################################
+#Environment settings                                   #
+##########################################################
+#Store all directory names to a list
+MODULES=(`ls ../tests/`)
+#Modify this path to point to correct path
+location=$HOME/situare/repository/situare/tests/
+FILE=$HOME/situare/repository/situare/scripts/tests_summary.txt
+if [ ! -e $FILE ]; then
+    touch tests_summary.txt
+    echo "##########################################" >> tests_summary.txt
+    echo "# Summary of unit tests executed         #" >> tests_summary.txt
+    echo "# Date: `date`    #" >> tests_summary.txt
+    echo "# User: `whoami`                            #" >> tests_summary.txt
+    echo "##########################################" >> tests_summary.txt
+fi  
+##########################################################
+#First part: Execution of all tests                      #
+##########################################################
+for component in "${MODULES[@]}"
+do
+  echo "Creating Qt project file for $component"
+  cd $location/$component
+  qmake -project "CONFIG+=qtestlib"
+  echo "Creating make file for $component"
+  qmake
+  echo "Building tests for $component"
+  make
+  echo "Running tests for $component"
+  ./$component -o testreport_$component.txt
+  echo "Cleaning $component"
+  make clean
+  rm Makefile
+  rm $component
+done
+
+#########################################################
+# Second part: Extraction of results                   #
+#########################################################
+echo "Summarizing test results....." 
+for component in "${MODULES[@]}"
+do
+    cd $location/$component
+    echo "############# $component ################" >> $FILE
+    grep Totals *.txt >> $FILE
+done
+exit 0
diff --git a/tests/testGPS/testGPS.pro b/tests/testGPS/testGPS.pro
new file mode 100644 (file)
index 0000000..d110437
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 12:37:27 2010
+######################################################################
+
+CONFIG+=qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += ../../src/ui/mainwindow.h
+SOURCES += testgps.cpp ../../src/ui/mainwindow.cpp
diff --git a/tests/testGPS/testgps.cpp b/tests/testGPS/testgps.cpp
new file mode 100755 (executable)
index 0000000..d6f3e57
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Henri Lampela - henri.lampela@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include "../../src/ui/mainwindow.h"
+
+class TestGps: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void testGps();
+
+
+};
+
+void TestGps::testGps()
+{
+    QLineEdit lineEdit;
+
+    QTest::keyClicks(&lineEdit, "UI test");
+
+    QCOMPARE(lineEdit.text(), QString("UI test"));
+}
+
+
+QTEST_MAIN(TestGps)
+#include "testgps.moc"
diff --git a/tests/testPHP/testPHP.pro b/tests/testPHP/testPHP.pro
new file mode 100644 (file)
index 0000000..c38e85f
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Mon Mar 29 12:37:32 2010
+######################################################################
+
+CONFIG+=qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += ../../src/ui/mainwindow.h
+SOURCES += testphp.cpp ../../src/ui/mainwindow.cpp
diff --git a/tests/testPHP/testphp.cpp b/tests/testPHP/testphp.cpp
new file mode 100755 (executable)
index 0000000..b4f0f6b
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Henri Lampela - henri.lampela@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include "../../src/ui/mainwindow.h"
+
+class TestPhp: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void testPhp();
+
+
+};
+
+void TestPhp::testPhp()
+{
+    QLineEdit lineEdit;
+
+    QTest::keyClicks(&lineEdit, "UI test");
+
+    QCOMPARE(lineEdit.text(), QString("UI test"));
+}
+
+
+QTEST_MAIN(TestPhp)
+#include "testphp.moc"