If so what technique should I use ? I am thinking about using hippomock as they can be used to mock "C" methods. Are there any better approaches ? If so can anyone give an advice, or do you think unit test for kernel is an overkill ?
Asked
Active
Viewed 2,898 times
6
-
Did you do a search on this topic? There are plenty of forum questions around. – Weather Vane Nov 05 '15 at 18:03
-
Yes, I did, looks like kernel development do not use any unit tests as such (as it is hard to do so), however I think it can be still done especially with mock frameworks – Marek Waszkiewicz Nov 05 '15 at 18:10
-
Unit testing is really hard to preform to the kernel, the main testing method for the linux-kernel is a huge community performing numerous testing and associated documentation. – PeCosta Nov 05 '15 at 18:52
-
It's certainly not easy, but you may be able to apply [some techniques for testing in embedded programming](https://pragprog.com/book/jgade/test-driven-development-for-embedded-c) to kernel modules. It very much depends on how many features of the rest of the kernel your module relies on, as you may need to mock those out, which can become impractical. – pmdj Nov 07 '15 at 10:32
-
1http://stackoverflow.com/questions/3177338/how-is-linux-kernel-tested/30367968 – Ciro Santilli OurBigBook.com Nov 09 '15 at 12:37
1 Answers
5
Since Linux kernel version 5.5 KUnit is available. It's a lightweight unit test framework for the kernel.
For more details have a look at

MarcusS
- 176
- 2
- 10