Re: [RFC v1 22/31] kunit: mock: add the concept of spyable functions

From: Rob Herring
Date: Wed Oct 17 2018 - 18:47:09 EST


On Tue, Oct 16, 2018 at 6:54 PM Brendan Higgins
<brendanhiggins@xxxxxxxxxx> wrote:
>
> Adds the concept of spying like in Mockito
> (http://static.javadoc.io/org.mockito/mockito-core/2.20.0/org/mockito/Mockito.html#spy-T-).
> This allows a function declaration to be labled as spyable which allows
> the function to be mocked *and* to allow the mock to invoke the original
> function definition.

We can already hook into arbitrary functions ftrace. Wouldn't
utilizing that simplify features like this and avoid having to touch
existing code for testing? Not sure what it would take to enable
ftrace on UML. It is at least partially compiler dependent.

Rob