I did a bit of refactoring here, and made UTs to run in host system. I injected mock system via a base class (which uses virtual calls) instead of macros and FAKE_SYS file generation: https://github.com/biocomp/ev3dev-lang-cpp2/blob/master/tests/api_tests.cpp.
I messed with cmake files and headers quite a lot, I guess I can simplify the change if there's an interest.
Also, there's a bug in the cache which I've found with the tests.