From 454096217002f02379b4450e6e3d312f46c8cda9 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 15 Jul 2009 13:27:45 +1000 Subject: Fixed recompile of tests/auto/selftests/exception. Turns out making a binary named `exception' is quite a bad idea... when some code does `#include ', guess which file gets picked up :-) --- tests/auto/selftests/exception/exception.pro | 9 --- tests/auto/selftests/exception/tst_exception.cpp | 69 ---------------------- .../selftests/exceptionthrow/exceptionthrow.pro | 9 +++ .../exceptionthrow/tst_exceptionthrow.cpp | 69 ++++++++++++++++++++++ tests/auto/selftests/expected_exception.txt | 7 --- tests/auto/selftests/expected_exceptionthrow.txt | 7 +++ tests/auto/selftests/selftests.pro | 2 +- tests/auto/selftests/selftests.qrc | 2 +- tests/auto/selftests/tst_selftests.cpp | 8 +-- 9 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 tests/auto/selftests/exception/exception.pro delete mode 100644 tests/auto/selftests/exception/tst_exception.cpp create mode 100644 tests/auto/selftests/exceptionthrow/exceptionthrow.pro create mode 100644 tests/auto/selftests/exceptionthrow/tst_exceptionthrow.cpp delete mode 100644 tests/auto/selftests/expected_exception.txt create mode 100644 tests/auto/selftests/expected_exceptionthrow.txt diff --git a/tests/auto/selftests/exception/exception.pro b/tests/auto/selftests/exception/exception.pro deleted file mode 100644 index 65705c6..0000000 --- a/tests/auto/selftests/exception/exception.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) -SOURCES += tst_exception.cpp -QT = core - -mac:CONFIG -= app_bundle -CONFIG -= debug_and_release_target - - -TARGET = exception diff --git a/tests/auto/selftests/exception/tst_exception.cpp b/tests/auto/selftests/exception/tst_exception.cpp deleted file mode 100644 index a54bfbe..0000000 --- a/tests/auto/selftests/exception/tst_exception.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include - -class tst_Exception: public QObject -{ - Q_OBJECT - -private slots: - void throwException() const; -}; - -/*! - \internal - - We simply throw an exception to check that we get sane output/reporting. - */ -void tst_Exception::throwException() const -{ - /* When exceptions are disabled, some compilers, at least linux-g++, treat - * exception clauses as hard errors. */ -#ifndef QT_NO_EXCEPTIONS - throw 3; -#endif -} - -QTEST_MAIN(tst_Exception) - -#include "tst_exception.moc" diff --git a/tests/auto/selftests/exceptionthrow/exceptionthrow.pro b/tests/auto/selftests/exceptionthrow/exceptionthrow.pro new file mode 100644 index 0000000..641818c --- /dev/null +++ b/tests/auto/selftests/exceptionthrow/exceptionthrow.pro @@ -0,0 +1,9 @@ +load(qttest_p4) +SOURCES += tst_exceptionthrow.cpp +QT = core + +mac:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + + +TARGET = exceptionthrow diff --git a/tests/auto/selftests/exceptionthrow/tst_exceptionthrow.cpp b/tests/auto/selftests/exceptionthrow/tst_exceptionthrow.cpp new file mode 100644 index 0000000..7a65c2d --- /dev/null +++ b/tests/auto/selftests/exceptionthrow/tst_exceptionthrow.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include + +class tst_Exception: public QObject +{ + Q_OBJECT + +private slots: + void throwException() const; +}; + +/*! + \internal + + We simply throw an exception to check that we get sane output/reporting. + */ +void tst_Exception::throwException() const +{ + /* When exceptions are disabled, some compilers, at least linux-g++, treat + * exception clauses as hard errors. */ +#ifndef QT_NO_EXCEPTIONS + throw 3; +#endif +} + +QTEST_MAIN(tst_Exception) + +#include "tst_exceptionthrow.moc" diff --git a/tests/auto/selftests/expected_exception.txt b/tests/auto/selftests/expected_exception.txt deleted file mode 100644 index 141ea8b..0000000 --- a/tests/auto/selftests/expected_exception.txt +++ /dev/null @@ -1,7 +0,0 @@ -********* Start testing of tst_Exception ********* -Config: Using QTest library 4.3.0, Qt 4.3.0 -PASS : tst_Exception::initTestCase() -FAIL! : tst_Exception::throwException() Caught unhandled exception - Loc: [/home/fenglich/dev/qt-4.3/tools/qtestlib/src/qtestcase.cpp(1220)] -Totals: 1 passed, 1 failed, 0 skipped -********* Finished testing of tst_Exception ********* diff --git a/tests/auto/selftests/expected_exceptionthrow.txt b/tests/auto/selftests/expected_exceptionthrow.txt new file mode 100644 index 0000000..141ea8b --- /dev/null +++ b/tests/auto/selftests/expected_exceptionthrow.txt @@ -0,0 +1,7 @@ +********* Start testing of tst_Exception ********* +Config: Using QTest library 4.3.0, Qt 4.3.0 +PASS : tst_Exception::initTestCase() +FAIL! : tst_Exception::throwException() Caught unhandled exception + Loc: [/home/fenglich/dev/qt-4.3/tools/qtestlib/src/qtestcase.cpp(1220)] +Totals: 1 passed, 1 failed, 0 skipped +********* Finished testing of tst_Exception ********* diff --git a/tests/auto/selftests/selftests.pro b/tests/auto/selftests/selftests.pro index ca69afa..45de658 100644 --- a/tests/auto/selftests/selftests.pro +++ b/tests/auto/selftests/selftests.pro @@ -3,7 +3,7 @@ TEMPLATE = subdirs SUBDIRS = subtest test warnings maxwarnings cmptest globaldata skipglobal skip \ strcmp expectfail sleep fetchbogus crashes multiexec failinit failinitdata \ skipinit skipinitdata datetime singleskip assert waitwithoutgui differentexec \ - exception qexecstringlist datatable commandlinedata\ + exceptionthrow qexecstringlist datatable commandlinedata\ benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \ benchliboptions xunit badxml diff --git a/tests/auto/selftests/selftests.qrc b/tests/auto/selftests/selftests.qrc index d57ff29..9dc9dd0 100644 --- a/tests/auto/selftests/selftests.qrc +++ b/tests/auto/selftests/selftests.qrc @@ -25,7 +25,7 @@ expected_fatal.txt expected_waitwithoutgui.txt expected_differentexec.txt - expected_exception.txt + expected_exceptionthrow.txt expected_qexecstringlist.txt expected_datatable.txt expected_commandlinedata.txt diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index de51f53..ba17ccb 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -170,7 +170,7 @@ void tst_Selftests::runSubTest_data() // with a warning that an uncaught exception was thrown. // This will time out and falsely fail, therefore we disable the test for that platform. # if !defined(Q_CC_INTEL) || !defined(Q_OS_WIN) - QTest::newRow("exception") << "exception" << QStringList(); + QTest::newRow("exceptionthrow") << "exceptionthrow" << QStringList(); # endif #endif QTest::newRow("qexecstringlist") << "qexecstringlist" << QStringList(); @@ -207,7 +207,7 @@ void tst_Selftests::doRunSubTest(QString &subdir, QStringList &arguments ) /* Windows-MSVC decide to output an error message when exceptions are thrown, * so let's not check stderr for those. */ #if defined(Q_OS_WIN) - if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus")) + if(subdir != QLatin1String("exceptionthrow") && subdir != QLatin1String("fetchbogus")) #endif if(subdir != QLatin1String("xunit")) QVERIFY2(err.isEmpty(), err.constData()); @@ -343,7 +343,7 @@ void tst_Selftests::checkXML() const * this is what windows platforms says: * "This application has requested the Runtime to terminate it in an unusual way. * Please contact the application's support team for more information." */ - if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus")) + if(subdir != QLatin1String("exceptionthrow") && subdir != QLatin1String("fetchbogus")) QVERIFY2(err.isEmpty(), err.constData()); QXmlStreamReader reader(out); @@ -385,7 +385,7 @@ void tst_Selftests::checkXunitxml() const * this is what windows platforms says: * "This application has requested the Runtime to terminate it in an unusual way. * Please contact the application's support team for more information." */ - if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus")) + if(subdir != QLatin1String("exceptionthrow") && subdir != QLatin1String("fetchbogus")) QVERIFY2(err.isEmpty(), err.constData()); QXmlStreamReader reader(out); -- cgit v0.12