using Google Test for Kernel Module

1,883 views
Skip to first unread message

Murugadoss

unread,
Feb 24, 2010, 6:37:15 AM2/24/10
to Google C++ Testing Framework
Hello,
I would like to know, whether google test can be used to test
kernel modules ? If possible, please provide me some more information
regarding this.

Thank u

Regards
Murugadoss

Alexander Demin

unread,
Feb 24, 2010, 11:44:56 AM2/24/10
to Murugadoss, Google C++ Testing Framework
Hi Murugadoss,

I suppose this is just a question of how your code is ready to be tested, right? If your classes can be instantiated in isolation it doesn't matter if it's kernel code or UI or something else. For example, I do test quite low level stuff using GTest but I had to refactor some code to make it working.

Alexander 

Mike

unread,
Feb 25, 2010, 6:32:22 AM2/25/10
to Google C++ Testing Framework
It really depends on how your kernel modules are written. Testing
kernel modules have all the same issues as testing any procedural code
(tightly coupled dependencies, no object oriented test seams, etc). I
have written a couple of blog posts with techniques that you might
find useful:

http://meekrosoft.wordpress.com/2009/11/09/unit-testing-c-code-with-the-googletest-framework/
http://meekrosoft.wordpress.com/2010/01/29/unit-test-embedded-software-in-3-easy-steps/

Regards,
Mike

Zhanyong Wan (λx.x x)

unread,
Feb 25, 2010, 11:52:02 AM2/25/10
to Mike, Google C++ Testing Framework
HI Mike,

Great articles! Thanks for sharing. I've linked to them on gtest's
homepage. Hope you don't mind. :-)

Cheers,

--
Zhanyong

Reply all
Reply to author
Forward
0 new messages