phosphor-logging in testing

Patrick Venture venture at google.com
Fri Aug 10 02:46:57 AEST 2018


So, phosphor-logging/log.hpp requires one to link in systemd, so
technically I can already argue it isn't a header-only code-base.
That said, I'm looking at how to enable testing such that we can
easily validate error code paths.

One approach is to move the code in the header such that it calls some
code in the library itself that we can swap out with a "body double."
Another approach is to have some global variable in that library that
one can flip when they want such that the tests throw an exception or
something useful to catch in a test.  Or just do nothing.

Is there anyone already tackling this problem?

Patrick


More information about the openbmc mailing list