From c91d9e62801aca5a12ca37429c39a71e6351d6d5 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 3 Nov 2009 13:07:02 +0000 Subject: More test framework changes... --- client/test.sh | 35 +++++++++++++++++++---------------- client/test/testcomboboxedit.cc | 7 ++++--- client/test/testcomboboxsearch.cc | 1 + client/test/testcomboboxselect.cc | 7 ++++--- client/test/testlineedit.cc | 1 + client/test/util.h | 1 + client/widgets/common.cc | 2 +- 7 files changed, 31 insertions(+), 23 deletions(-) (limited to 'client') diff --git a/client/test.sh b/client/test.sh index 83dc675..cbd0184 100755 --- a/client/test.sh +++ b/client/test.sh @@ -5,6 +5,9 @@ TEST_PRO=test.pro MAKEFILE=Makefile.test TEST_APP=test_app +# Make sure that pracro.cc gets compiled again with the TESTING flags set. +touch pracro.cc + if [ -z $1 ] then TESTFILES=test/test*.cc @@ -25,25 +28,25 @@ do echo Compiling $TEST test: >> $OUTPUT echo ${COMPILE} >> $OUTPUT cpp -P -E -DTESTFILE=\"$TEST\" $TEST_PRO_IN -o $TEST_PRO - qmake -makefile $TEST_PRO -o $MAKEFILE + qmake -makefile $TEST_PRO -o $MAKEFILE if make -f $MAKEFILE 2>&1 >> ${OUTPUT}; then - echo -e "\r\t\t\t\t\t\t[\033[1;32mSuccess\033[0;2m]" - echo "[Success]" >> $OUTPUT - - echo -n "* Running $TEST test" - echo Running $TEST test: >> $OUTPUT - if ./$TEST_APP 2>&1 >> $OUTPUT ; then - echo -e "\r\t\t\t\t\t\t[\033[1;32mSuccess\033[0;2m]" - echo "[Success]" >> $OUTPUT - else - echo -e "\r\t\t\t\t\t\t[\033[1;31mFailure\033[0;2m]" - echo "[Failure]" >> $OUTPUT - fi + echo -e "\r\t\t\t\t\t\t[\033[1;32mSuccess\033[0;2m]" + echo "[Success]" >> $OUTPUT + + echo -n "* Running $TEST test" + echo Running $TEST test: >> $OUTPUT + if ./$TEST_APP 2>&1 >> $OUTPUT ; then + echo -e "\r\t\t\t\t\t\t[\033[1;32mSuccess\033[0;2m]" + echo "[Success]" >> $OUTPUT + else + echo -e "\r\t\t\t\t\t\t[\033[1;31mFailure\033[0;2m]" + echo "[Failure]" >> $OUTPUT + fi else - echo -e "\r\t\t\t\t\t\t[\033[1;31mFailure\033[0;2m]" - echo "[Failure]" >> $OUTPUT + echo -e "\r\t\t\t\t\t\t[\033[1;31mFailure\033[0;2m]" + echo "[Failure]" >> $OUTPUT fi - rm -f $MAKEFILE $TEST_PRO $TEST_APP + rm -f $MAKEFILE $TEST_PRO $TEST_APP done diff --git a/client/test/testcomboboxedit.cc b/client/test/testcomboboxedit.cc index 5294886..7fdbfb1 100644 --- a/client/test/testcomboboxedit.cc +++ b/client/test/testcomboboxedit.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include #include "util.h" #include "combobox.h" @@ -24,7 +25,7 @@ static QString xml_select = " \n" "\n"; -class TestComboBox: public QObject +class TestComboBoxEdit: public QObject { Q_OBJECT private slots: @@ -66,7 +67,7 @@ private slots: } }; -QTEST_MAIN(TestComboBox) -#include "testcombobox.moc" +QTEST_MAIN(TestComboBoxEdit) +#include "testcomboboxedit.moc" diff --git a/client/test/testcomboboxsearch.cc b/client/test/testcomboboxsearch.cc index 84f03c4..7ac0db4 100644 --- a/client/test/testcomboboxsearch.cc +++ b/client/test/testcomboboxsearch.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include #include "util.h" #include "combobox.h" diff --git a/client/test/testcomboboxselect.cc b/client/test/testcomboboxselect.cc index 5294886..1439440 100644 --- a/client/test/testcomboboxselect.cc +++ b/client/test/testcomboboxselect.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include #include "util.h" #include "combobox.h" @@ -24,7 +25,7 @@ static QString xml_select = " \n" "\n"; -class TestComboBox: public QObject +class TestComboBoxSelect: public QObject { Q_OBJECT private slots: @@ -66,7 +67,7 @@ private slots: } }; -QTEST_MAIN(TestComboBox) -#include "testcombobox.moc" +QTEST_MAIN(TestComboBoxSelect) +#include "testcomboboxselect.moc" diff --git a/client/test/testlineedit.cc b/client/test/testlineedit.cc index c5ab8b3..8b30295 100644 --- a/client/test/testlineedit.cc +++ b/client/test/testlineedit.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include #include "util.h" #include "lineedit.h" diff --git a/client/test/util.h b/client/test/util.h index 98da0e9..89a887d 100644 --- a/client/test/util.h +++ b/client/test/util.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include "macrowindow.h" #include diff --git a/client/widgets/common.cc b/client/widgets/common.cc index b650701..3d4458d 100644 --- a/client/widgets/common.cc +++ b/client/widgets/common.cc @@ -101,5 +101,5 @@ bool isUserSource(QString source) { if(source == "pentominos") return true; if(source == "pracro") return false; - return false; + return true; } -- cgit v1.2.3