Hi Daniel,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on 10b82d5176488acee2820e5a2cf0f2ec5c3488b6]
url:
https://github.com/0day-ci/linux/commits/Daniel-Latypov/kunit-introduce-c...
base: 10b82d5176488acee2820e5a2cf0f2ec5c3488b6
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from lib/kunit/kunit-example-test.c:10:
> lib/kunit/kunit-example-test.c:60:33: warning: no previous
prototype for 'foo' [-Wmissing-prototypes]
60 |
DEFINE_STRUCT_CLASS_MOCK(METHOD(foo), CLASS(example),
| ^~~
include/kunit/mock.h:328:15: note: in definition of macro
'DEFINE_MOCK_CLIENT_COMMON'
328 | return_type name(PARAM_LIST_FROM_TYPES(param_types)) \
| ^~~~
include/kunit/mock.h:380:3: note: in expansion of macro
'DEFINE_MOCK_METHOD_CLIENT_COMMON'
380 | DEFINE_MOCK_METHOD_CLIENT_COMMON(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:437:3: note: in expansion of macro
'DEFINE_MOCK_METHOD_CLIENT'
437 | DEFINE_MOCK_METHOD_CLIENT(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:459:3: note: in expansion of macro 'DEFINE_MOCK_COMMON'
459 | DEFINE_MOCK_COMMON(name, \
| ^~~~~~~~~~~~~~~~~~
include/kunit/mock.h:468:3: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
468 | DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:506:3: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
506 | DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/kunit/kunit-example-test.c:60:1: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK'
60 | DEFINE_STRUCT_CLASS_MOCK(METHOD(foo), CLASS(example),
| ^~~~~~~~~~~~~~~~~~~~~~~~
lib/kunit/kunit-example-test.c:60:26: note: in expansion of macro 'METHOD'
60 | DEFINE_STRUCT_CLASS_MOCK(METHOD(foo), CLASS(example),
| ^~~~~~
> include/kunit/mock.h:402:28: warning: no previous prototype for
'mock_master_foo' [-Wmissing-prototypes]
402 | struct
mock_expectation *mock_master_##name( \
| ^~~~~~~~~~~~
include/kunit/mock.h:420:3: note: in expansion of macro
'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
420 | DEFINE_MOCK_MASTER_COMMON_INTERNAL(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:427:3: note: in expansion of macro
'DEFINE_MOCK_MASTER_COMMON'
427 | DEFINE_MOCK_MASTER_COMMON(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:442:3: note: in expansion of macro
'DEFINE_MOCK_METHOD_MASTER'
442 | DEFINE_MOCK_METHOD_MASTER(name, handle_index, param_types)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:459:3: note: in expansion of macro 'DEFINE_MOCK_COMMON'
459 | DEFINE_MOCK_COMMON(name, \
| ^~~~~~~~~~~~~~~~~~
include/kunit/mock.h:468:3: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
468 | DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/mock.h:506:3: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
506 | DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/kunit/kunit-example-test.c:60:1: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK'
60 | DEFINE_STRUCT_CLASS_MOCK(METHOD(foo), CLASS(example),
| ^~~~~~~~~~~~~~~~~~~~~~~~
> lib/kunit/kunit-example-test.c:85:31: warning: no previous
prototype for 'examplemock_init' [-Wmissing-prototypes]
85 |
DEFINE_STRUCT_CLASS_MOCK_INIT(example, example_init);
| ^~~~~~~
include/kunit/mock.h:194:35: note: in definition of macro 'MOCK_INIT_ID'
194 | #define MOCK_INIT_ID(struct_name) struct_name##mock_init
| ^~~~~~~~~~~
lib/kunit/kunit-example-test.c:85:1: note: in expansion of macro
'DEFINE_STRUCT_CLASS_MOCK_INIT'
85 | DEFINE_STRUCT_CLASS_MOCK_INIT(example, example_init);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
https://github.com/0day-ci/linux/commit/80a5526fd886c8b3d5ad6ba475b3d1087...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Daniel-Latypov/kunit-introduce-class-mocking-support/20200919-023253
git checkout 80a5526fd886c8b3d5ad6ba475b3d1087943f70a
vim +/foo +60 lib/kunit/kunit-example-test.c
55
56 /*
57 * This macro creates a mock implementation of the specified method of the
58 * specified class.
59 */
60 DEFINE_STRUCT_CLASS_MOCK(METHOD(foo), CLASS(example),
61 RETURNS(int),
62 PARAMS(struct example *, int));
63
64 /*
65 * This tells KUnit how to initialize the parts of the mock that come from the
66 * parent. In this example, all we have to do is populate the member functions
67 * of the parent class with the mock versions we defined.
68 */
69 static int example_init(struct MOCK(example) *mock_example)
70 {
71 /* This is how you get a pointer to the parent class of a mock. */
72 struct example *example = mock_get_trgt(mock_example);
73
74 /*
75 * Here we populate the member function (method) with our mock method.
76 */
77 example->foo = foo;
78 return 0;
79 }
80
81 /*
82 * This registers our parent init function above, allowing KUnit to create a
83 * constructor for the mock.
84 */
85 DEFINE_STRUCT_CLASS_MOCK_INIT(example, example_init);
86
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org