Gabriele Monaco <[email protected]> writes: > Some monitors do not only rely on tracepoint arguments but also on the > currently executing task. > This makes it more challenging to mock events in KUnit. > > Define wrapper functions around current, the functionality is mocked > only during KUnit, an additional function call is avoided using a static > branch unless any (even unrelated) KUnit test is running. > > Rely on a global mock_current variable that is set only by the RV KUnit > tests and cleared on teardown. Unrelated KUnit tests that happen to > trigger RV handlers would see it null and use current. > > Signed-off-by: Gabriele Monaco <[email protected]>
Reviewed-by: Nam Cao <[email protected]>
