I’m trying to apply unit testing and tdd for linux kernel modules and device drivers.
I have two options: 1. emulate whole kernel api and run test as userspace application 2. rewrite Unity somehow to operate on kernel level, and run the test as kernel module in virtual machine
The first option seems unreal. Of course, I can redefine kmalloc to malloc, but substitute the whole api? No way.
It looks more promising to reuse Unity code to create kernel-level test framework. But what about test-driving? I need to reset virtual machine after previous test crash, boot it (most time-consuming part), upload and insert test module.