From: Jukka Saastamoinen Date: Mon, 29 Mar 2010 11:27:03 +0000 (+0300) Subject: Updates master test script to match project directory structure. X-Git-Tag: v0.2~72 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=e84e64eb0a28adb2157879c2211f5308bc3ce9fd;p=situare Updates master test script to match project directory structure. --- diff --git a/scripts/master_test_script.sh b/scripts/master_test_script.sh index 10df1b4..781cfe0 100755 --- a/scripts/master_test_script.sh +++ b/scripts/master_test_script.sh @@ -23,34 +23,48 @@ if [ ! -e $FILE ]; then echo "# User: `whoami` #" >> tests_summary.txt echo "##########################################" >> tests_summary.txt fi + ########################################################## #First part: Execution of all tests # ########################################################## -for component in "${MODULES[@]}" +for component in "${MODULES[@]}" #Loop through components 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 + CASES=(`ls`) #List all test cases uner component directory + for unittest in "${CASES[@]}" + do + cd $location/$component/$unittest + if [ $component = "testMap" ]; then + qmake + else + qmake -project "CONFIG+=qtestlib" + echo "Creating make file for $component/$unittest" + qmake + fi + echo "Building tests for $component/$unittest" + make + echo "Running tests for $component/$unittest" + ./$unittest -o testreport_$component.txt + echo "Cleaning $unittest" + make clean + rm Makefile + rm $unittest + done done ######################################################### # Second part: Extraction of results # ######################################################### echo "Summarizing test results....." -for component in "${MODULES[@]}" -do - cd $location/$component - echo "############# $component ################" >> $FILE +for component in "${MODULES[@]}" #Loop through components +do + cd $location/$component + CASES=(`ls`) #List all test cases uner component directory + for unittests in "${CASES[@]}" + do + cd $location/$component/$unittests + echo "############# $component/$unittests ################" >> $FILE grep Totals *.txt >> $FILE + done done exit 0 diff --git a/tests/testGPS/testGPS.pro b/tests/testGPS/testGPS.pro deleted file mode 100644 index 8a11147..0000000 --- a/tests/testGPS/testGPS.pro +++ /dev/null @@ -1,13 +0,0 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Mon Mar 29 13:04:35 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 deleted file mode 100755 index d6f3e57..0000000 --- a/tests/testGPS/testgps.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - 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 -#include -#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 deleted file mode 100644 index 0dc333c..0000000 --- a/tests/testPHP/testPHP.pro +++ /dev/null @@ -1,13 +0,0 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Mon Mar 29 13:04:40 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 deleted file mode 100755 index b4f0f6b..0000000 --- a/tests/testPHP/testphp.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - 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 -#include -#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" diff --git a/tests/testUI/testUI.pro b/tests/testUI/testUI.pro deleted file mode 100644 index 1785010..0000000 --- a/tests/testUI/testUI.pro +++ /dev/null @@ -1,13 +0,0 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Mon Mar 29 13:04:45 2010 -###################################################################### - -CONFIG+=qtestlib -TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . - -# Input -HEADERS += ../../src/ui/mainwindow.h -SOURCES += testui.cpp ../../src/ui/mainwindow.cpp diff --git a/tests/testUI/testui.cpp b/tests/testUI/testui.cpp deleted file mode 100755 index c8e05d7..0000000 --- a/tests/testUI/testui.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - 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 -#include -#include "../../src/ui/mainwindow.h" - -class TestUi: public QObject -{ - Q_OBJECT - -private slots: - void testUi(); - - -}; - -void TestUi::testUi() -{ - QLineEdit lineEdit; - - QTest::keyClicks(&lineEdit, "UI tests"); - - QCOMPARE(lineEdit.text(), QString("UI test")); -} - - -QTEST_MAIN(TestUi) -#include "testui.moc"