More about kdelibs unittests
David Faure
faure at kde.org
Thu Dec 9 23:44:09 GMT 2010
On Thursday 09 December 2010, Aurélien Gâteau wrote:
> On 09/12/2010 17:52, David Faure wrote:
> > On Tuesday 07 December 2010, Jaime wrote:
> >> Hi,
> >>
> >> I've run the kdelibs with the environment variable
> >> QT_FATAL_WARNINGS=1,
> >>
> >> and the number of failed tests has grown in a noticeable way. (also with
> >> 2 crashes).
> >>
> >> I guess that less Qt warnings usually means less unexpected crashes.
> >> Therefore I suggest to add that variable to the test target, and if
> >> it is
> >>
> >> possible, to fix the failed unittests before 4.6.0 is released.
> >
> > I disagree that this makes sense.
> >
> > $ ./kconfigguitest
> > ********* Start testing of KConfigTest *********
> > Config: Using QTest library 4.7.0, Qt 4.7.0
> > PASS : KConfigTest::initTestCase()
> > PASS : KConfigTest::testComplex()
> > QWARN : KConfigTest::testInvalid() QColor::setNamedColor: Unknown color
> > name '1'
> >
> > Yes, this will crash with QT_FATAL_WARNINGS. So? It's good to have a unit
> > test test border conditions too, even if these conditions lead to
> > warnings from Qt.
>
> One could try to use QTest::ignoreMessage() [1] to skip expected error
> messages.
Does not help. It removes the above QWARN line when running the test normally,
but with QT_FATAL_WARNING the call to qWarning will still abort immediately.
Wrong layer.
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
More information about the kde-core-devel
mailing list