[Kde-hardware-devel] Testing programs using Solid

Kevin Ottens ervin at kde.org
Sun Feb 10 18:36:51 CET 2008


Le Thursday 07 February 2008, Chris Gow a écrit :
> Ideally, I would like to be able to do something like:
> - For my unit test harness, instantiate a dummy device manager. This should
> only affect the current running program, not replace the system solid
> manager.
>
> - Feed the dummy manager test devices that implement the particular
> interface it looks for. These test devices would be completely fake, but
> should look and behave like real devices.

All your dreams are already fullfilled. You just need to set the SOLID_FAKEHW 
environment variable to point to the file containing the data to feed the 
fake backend.

We have a pretty generic file to use with the fake backend:
kdelibs/solid/solid/backends/fakehw/fakecomputer.xml

I use that for all my tests. You might want to take a look at 
kdelibs/solid/tests/* and kdelibs/kfile/tests/kfileplacesmodeltest.cpp

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20080210/5522d57c/attachment.pgp 


More information about the Kde-hardware-devel mailing list