Switching to QtTestLib for unit tests

David Faure faure at kde.org
Sat Sep 3 16:53:51 BST 2005


On Saturday 03 September 2005 17:23, Frans Englich wrote:
> On Saturday 03 September 2005 09:52, David Faure wrote:
> [...]
> 
> > If you wonder what switching would mean: see attached diff for
> > ktempfiletest, including the full diff for importing qttestlib to kdelibs.
> > To get an automake-ready qttestlib, unpack
> > http://kdab.net/~dfaure/qttestlib.diff.bz2 in the toplevel of kdelibs.
> >
> > OK with everyone?
> 
> It sounds great for the reasons you mention. I felt a small resistance for 
> porting existing KUnitTest code, but change is the pre-requisite for 
> improvement, as simple as it sounds. Not that it requires much work, I 
> realized after looking at the patch.

Exactly, this is why I posted the patch ;)
I will port to qttestlib at least all kdelibs tests currently using kunittest.

> QTestLib looks great, but I see one feature regression: support for testing of 
> exception throwing. KUnitTest got patched for this, it is currently used in 
> kdom/. Considering its current small use I don't think it should prevent a 
> switch, but it would for sure be of interest to not have the feature 
> regression(IMHO).

Harald has already left akademy, so I can't ask him in direct voice, I'm cc'ing him instead.

> I will probably submit a feature request to bugs@, but perhaps someone knows 
> the likelyhood of that exception-testing gets added to QTestLib?

To be honest with ourselves, we use very very little exceptions in KDE at the moment,
and I think it's easy to add templates/macros/testcode that tests for exceptions, on top of
qttestlib.

> PS. It's in cases like this it would be great if SVN had multi-site 
> functionality combined with that Qt kept stuff on an SVN server, such that 
> one could do external fetches(IMHO).

Well anyway we have to change at least the build system,
so only the cpp/h files need to be sync'ed, not the entire subtree.
Plus we might have to install it with another name to avoid conflicts with the real qttestlib?
Although... since we don't modify it (other than the extra file containing the kapp macro)
it is actually useable for qt-only GPL programs. Harald: do you think we should install it
as libqttestlib.{so,la} and $kdeprefix/include/QtTest/*.h  (like my current Makefile.am does),
or as libkdetestlib.{so,la} and KDETest/*.h to allow installing QtTestLib in parallel?
(IMHO the first one is fine in this case)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list