I know this is a bit ugly (I assume the PARENTSRC part) but I don't see very clean options otherwise.
1) Adding dinput(8) tests to ntoskrnl.exe doesn't sound great to me. Even more because I think that most, if not all, dinput tests should be done with a controlled driver. Otherwise only mouse and keyboard tests are going to be run often, and the rest will just quickly bitrot or be useless.
Even for hid, it really seems weird to me to have these tests live in ntoskrnl.exe, they aren't testing wdm or the hid driver at all, but instead most of it is about hid.dll, and a few tests about hidclass.sys.
2) Duplicating the code everywhere sounds even worse, especially "ntoskrnl.exe/tests/utils.h" and the driver test signing and loading code, which are non-trivial and meant to work together.
(The HID test driver too, as I intend to make it completely controllable and usable for other modules, but I can see reasons to fork it.)
Moving "ntoskrnl.exe/tests/utils.h" to "include/wine/ktest.h", may be a way around that, but the driver loading code is still an issue that I don't really know how to solve.
Cheers,