audiohacked / OpenCorsairLink

Linux and Mac OS support for the CorsairLink Devices
GNU General Public License v2.0
704 stars 126 forks source link

Unit Tests #124

Open audiohacked opened 6 years ago

audiohacked commented 6 years ago

Is your feature request related to a problem? Please describe. I'm always wondering if the OpenCorsairLink code logic is correct.

Describe the solution you'd like I'd like as much unit test coverage as possible. Considering OpenCorsairLink deals with actual hardware, we would need mock test to test all of the hardware variants.

Describe alternatives you've considered None

Additional context N/A

Ravenslofty commented 6 years ago

Hi! I'm from the ckb-next team, and we had a similar problem on our end. Our solution was to hack a USBIP driver into submission, and we got the mess that is FaKeyboard.

Given we're both working on Corsair stuff, it'd be nice if you visited our IRC (Freenode #ckb-next).

audiohacked commented 6 years ago

I found a set of articles on how to unit test software that interacts with hardware. http://blog.wingman-sw.com/archives/category/mocking-hardware http://blog.wingman-sw.com/archives/7#more-7 http://blog.wingman-sw.com/archives/8#more-8 http://blog.wingman-sw.com/archives/507#more-507

audiohacked commented 6 years ago

Also, I'm looking at CMocka as the Unit Testing Library.

audiohacked commented 6 years ago

Here's an article on using CMocka: https://lwn.net/Articles/558106/