Re: [PATCH v6 3/3] rust: kunit: allow to know if we are in a test

2025-02-15 Thread Tamir Duberstein
On Sat, Feb 15, 2025 at 4:03 AM David Gow wrote: > > On Fri, 14 Feb 2025 at 22:41, Tamir Duberstein wrote: > > > > On Fri, Feb 14, 2025 at 2:42 AM David Gow wrote: > > > > > > From: José Expósito > > > > > > In some cases, we need to call test-only code from outside the test > > > case, for exa

Re: [PATCH v6 3/3] rust: kunit: allow to know if we are in a test

2025-02-15 Thread David Gow
On Fri, 14 Feb 2025 at 22:41, Tamir Duberstein wrote: > > On Fri, Feb 14, 2025 at 2:42 AM David Gow wrote: > > > > From: José Expósito > > > > In some cases, we need to call test-only code from outside the test > > case, for example, to mock a function or a module. > > > > In order to check whet

Re: [PATCH v6 3/3] rust: kunit: allow to know if we are in a test

2025-02-14 Thread Tamir Duberstein
On Fri, Feb 14, 2025 at 2:42 AM David Gow wrote: > > From: José Expósito > > In some cases, we need to call test-only code from outside the test > case, for example, to mock a function or a module. > > In order to check whether we are in a test or not, we need to test if > `CONFIG_KUNIT` is set.

[PATCH v6 3/3] rust: kunit: allow to know if we are in a test

2025-02-13 Thread David Gow
From: José Expósito In some cases, we need to call test-only code from outside the test case, for example, to mock a function or a module. In order to check whether we are in a test or not, we need to test if `CONFIG_KUNIT` is set. Unfortunately, we cannot rely only on this condition because: -