All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC v2 10/12] kunit: mock: add class mocking support
Date: Tue, 13 Oct 2020 10:45:22 +0800	[thread overview]
Message-ID: <202010131023.W6NJA2pb-lkp@intel.com> (raw)
In-Reply-To: <20201012222050.999431-11-dlatypov@google.com>

[-- Attachment #1: Type: text/plain, Size: 28649 bytes --]

Hi Daniel,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on 10b82d5176488acee2820e5a2cf0f2ec5c3488b6]

url:    https://github.com/0day-ci/linux/commits/Daniel-Latypov/kunit-introduce-class-mocking-support/20201013-062218
base:    10b82d5176488acee2820e5a2cf0f2ec5c3488b6
config: arm64-randconfig-r003-20201012 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project a324d8f964bf421fa7d8b882b0f64ead28c4149c)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/9e162e8cc1ac27ab6de97d84033753ff486214e9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Latypov/kunit-introduce-class-mocking-support/20201013-062218
        git checkout 9e162e8cc1ac27ab6de97d84033753ff486214e9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> lib/kunit/mock-macro-test.c:24:33: warning: no previous prototype for function 'one_param' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(one_param), CLASS(mock_macro_dummy_struct),
                                   ^
   lib/kunit/mock-macro-test.c:25:13: note: declare 'static' if the function is not intended to be used outside of this translation unit
                            RETURNS(int),
                                    ^
   include/kunit/mock.h:191:30: note: expanded from macro 'RETURNS'
   #define RETURNS(return_type) return_type
                                ^
   include/kunit/mock.h:509:13: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                                                         return_type,             \
                                                         ^
   include/kunit/mock.h:471:15: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                                                                  return_type,    \
                                                                  ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:383:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT'
                                                    return_type,                  \
                                                    ^
   include/kunit/mock.h:368:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT_COMMON'
                                             return_type,                         \
                                             ^
   include/kunit/mock.h:328:3: note: expanded from macro 'DEFINE_MOCK_CLIENT_COMMON'
                   return_type name(PARAM_LIST_FROM_TYPES(param_types))           \
                   ^
>> lib/kunit/mock-macro-test.c:24:1: warning: no previous prototype for function 'mock_master_one_param' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(one_param), CLASS(mock_macro_dummy_struct),
   ^
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:28: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                                            ^
   <scratch space>:150:1: note: expanded from here
   mock_master_one_param
   ^
   lib/kunit/mock-macro-test.c:24:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:427:3: note: expanded from macro 'DEFINE_MOCK_METHOD_MASTER'
                   DEFINE_MOCK_MASTER_COMMON(name,                                \
                   ^
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                   ^
>> lib/kunit/mock-macro-test.c:28:33: warning: no previous prototype for function 'two_param' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(two_param), CLASS(mock_macro_dummy_struct),
                                   ^
   lib/kunit/mock-macro-test.c:29:13: note: declare 'static' if the function is not intended to be used outside of this translation unit
                            RETURNS(int),
                                    ^
   include/kunit/mock.h:191:30: note: expanded from macro 'RETURNS'
   #define RETURNS(return_type) return_type
                                ^
   include/kunit/mock.h:509:13: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                                                         return_type,             \
                                                         ^
   include/kunit/mock.h:471:15: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                                                                  return_type,    \
                                                                  ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:383:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT'
                                                    return_type,                  \
                                                    ^
   include/kunit/mock.h:368:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT_COMMON'
                                             return_type,                         \
                                             ^
   include/kunit/mock.h:328:3: note: expanded from macro 'DEFINE_MOCK_CLIENT_COMMON'
                   return_type name(PARAM_LIST_FROM_TYPES(param_types))           \
                   ^
>> lib/kunit/mock-macro-test.c:28:1: warning: no previous prototype for function 'mock_master_two_param' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(two_param), CLASS(mock_macro_dummy_struct),
   ^
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:28: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                                            ^
   <scratch space>:113:1: note: expanded from here
   mock_master_two_param
   ^
   lib/kunit/mock-macro-test.c:28:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:427:3: note: expanded from macro 'DEFINE_MOCK_METHOD_MASTER'
                   DEFINE_MOCK_MASTER_COMMON(name,                                \
                   ^
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                   ^
>> lib/kunit/mock-macro-test.c:32:46: warning: no previous prototype for function 'non_first_slot_param' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(METHOD(non_first_slot_param),
                                                ^
   lib/kunit/mock-macro-test.c:34:13: note: declare 'static' if the function is not intended to be used outside of this translation unit
                            RETURNS(int),
                                    ^
   include/kunit/mock.h:191:30: note: expanded from macro 'RETURNS'
   #define RETURNS(return_type) return_type
                                ^
   include/kunit/mock.h:471:15: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                                                                  return_type,    \
                                                                  ^
   include/kunit/mock.h:462:8: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                                      return_type, param_types)
                                      ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:383:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT'
                                                    return_type,                  \
                                                    ^
   include/kunit/mock.h:368:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT_COMMON'
                                             return_type,                         \
                                             ^
   include/kunit/mock.h:328:3: note: expanded from macro 'DEFINE_MOCK_CLIENT_COMMON'
                   return_type name(PARAM_LIST_FROM_TYPES(param_types))           \
                   ^
>> lib/kunit/mock-macro-test.c:32:1: warning: no previous prototype for function 'mock_master_non_first_slot_param' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(METHOD(non_first_slot_param),
   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   include/kunit/mock.h:442:3: note: expanded from macro 'DEFINE_MOCK_COMMON'
                   DEFINE_MOCK_METHOD_MASTER(name, handle_index, param_types)
                   ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:28: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                                            ^
   <scratch space>:310:1: note: expanded from here
   mock_master_non_first_slot_param
   ^
   lib/kunit/mock-macro-test.c:32:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   include/kunit/mock.h:442:3: note: expanded from macro 'DEFINE_MOCK_COMMON'
                   DEFINE_MOCK_METHOD_MASTER(name, handle_index, param_types)
                   ^
   include/kunit/mock.h:427:3: note: expanded from macro 'DEFINE_MOCK_METHOD_MASTER'
                   DEFINE_MOCK_MASTER_COMMON(name,                                \
                   ^
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                   ^
>> lib/kunit/mock-macro-test.c:37:33: warning: no previous prototype for function 'void_ptr_return' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(void_ptr_return),
                                   ^
   lib/kunit/mock-macro-test.c:39:13: note: declare 'static' if the function is not intended to be used outside of this translation unit
                            RETURNS(void *),
                                    ^
   include/kunit/mock.h:191:30: note: expanded from macro 'RETURNS'
   #define RETURNS(return_type) return_type
                                ^
   include/kunit/mock.h:509:13: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                                                         return_type,             \
                                                         ^
   include/kunit/mock.h:471:15: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                                                                  return_type,    \
                                                                  ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:383:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT'
                                                    return_type,                  \
                                                    ^
   include/kunit/mock.h:368:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT_COMMON'
                                             return_type,                         \
                                             ^
   include/kunit/mock.h:328:3: note: expanded from macro 'DEFINE_MOCK_CLIENT_COMMON'
                   return_type name(PARAM_LIST_FROM_TYPES(param_types))           \
                   ^
>> lib/kunit/mock-macro-test.c:37:1: warning: no previous prototype for function 'mock_master_void_ptr_return' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(void_ptr_return),
   ^
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:28: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                                            ^
   <scratch space>:58:1: note: expanded from here
   mock_master_void_ptr_return
   ^
   lib/kunit/mock-macro-test.c:37:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:427:3: note: expanded from macro 'DEFINE_MOCK_METHOD_MASTER'
                   DEFINE_MOCK_MASTER_COMMON(name,                                \
                   ^
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                   ^
>> lib/kunit/mock-macro-test.c:54:1: error: too many arguments to function call, expected single argument 'mock_test_struct', have 2 arguments
   DEFINE_STRUCT_CLASS_MOCK_INIT(mock_macro_dummy_struct,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/mock.h:553:24: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_INIT'
                           if (init_func(test, mock_obj))                         \
                               ~~~~~~~~~       ^~~~~~~~
   lib/kunit/mock-macro-test.c:42:12: note: 'mock_macro_dummy_struct_init' declared here
   static int mock_macro_dummy_struct_init(
              ^
>> lib/kunit/mock-macro-test.c:54:1: warning: no previous prototype for function 'mock_macro_dummy_structmock_init' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK_INIT(mock_macro_dummy_struct,
   ^
   include/kunit/mock.h:540:29: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_INIT'
                   struct MOCK(struct_name) *MOCK_INIT_ID(struct_name)(           \
                                             ^
   include/kunit/mock.h:194:35: note: expanded from macro 'MOCK_INIT_ID'
   #define MOCK_INIT_ID(struct_name) struct_name##mock_init
                                     ^
   <scratch space>:101:1: note: expanded from here
   mock_macro_dummy_structmock_init
   ^
   lib/kunit/mock-macro-test.c:54:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   DEFINE_STRUCT_CLASS_MOCK_INIT(mock_macro_dummy_struct,
   ^
   static 
   include/kunit/mock.h:540:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_INIT'
                   struct MOCK(struct_name) *MOCK_INIT_ID(struct_name)(           \
                   ^
   9 warnings and 1 error generated.
--
>> lib/kunit/mock-test.c:28:33: warning: no previous prototype for function 'mock_add' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(mock_add), CLASS(adder), RETURNS(int),
                                   ^
   lib/kunit/mock-test.c:28:66: note: declare 'static' if the function is not intended to be used outside of this translation unit
   DEFINE_STRUCT_CLASS_MOCK(METHOD(mock_add), CLASS(adder), RETURNS(int),
                                                                    ^
   static 
   include/kunit/mock.h:191:30: note: expanded from macro 'RETURNS'
   #define RETURNS(return_type) return_type
                                ^
   include/kunit/mock.h:509:13: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                                                         return_type,             \
                                                         ^
   include/kunit/mock.h:471:15: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                                                                  return_type,    \
                                                                  ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:383:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT'
                                                    return_type,                  \
                                                    ^
   include/kunit/mock.h:368:8: note: expanded from macro 'DEFINE_MOCK_METHOD_CLIENT_COMMON'
                                             return_type,                         \
                                             ^
   include/kunit/mock.h:328:3: note: expanded from macro 'DEFINE_MOCK_CLIENT_COMMON'
                   return_type name(PARAM_LIST_FROM_TYPES(param_types))           \
                   ^
>> lib/kunit/mock-test.c:28:1: warning: no previous prototype for function 'mock_master_mock_add' [-Wmissing-prototypes]
   DEFINE_STRUCT_CLASS_MOCK(METHOD(mock_add), CLASS(adder), RETURNS(int),
   ^
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:28: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                                            ^
   <scratch space>:10:1: note: expanded from here
   mock_master_mock_add
   ^
   lib/kunit/mock-test.c:28:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   include/kunit/mock.h:506:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(name,                    \
                   ^
   include/kunit/mock.h:468:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX'
                   DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL(name,           \
                   ^
   include/kunit/mock.h:459:3: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX_INTERNAL'
                   DEFINE_MOCK_COMMON(name,                                       \
                   ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/kunit/mock.h:427:3: note: expanded from macro 'DEFINE_MOCK_METHOD_MASTER'
                   DEFINE_MOCK_MASTER_COMMON(name,                                \
                   ^
   include/kunit/mock.h:420:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON'
                   DEFINE_MOCK_MASTER_COMMON_INTERNAL(name,                       \
                   ^
   include/kunit/mock.h:402:3: note: expanded from macro 'DEFINE_MOCK_MASTER_COMMON_INTERNAL'
                   struct mock_expectation *mock_master_##name(                   \
                   ^
>> lib/kunit/mock-test.c:46:1: error: too many arguments to function call, expected single argument 'mock_adder', have 2 arguments
   DEFINE_STRUCT_CLASS_MOCK_INIT(adder, adder_mock_init);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/mock.h:553:24: note: expanded from macro 'DEFINE_STRUCT_CLASS_MOCK_INIT'
                           if (init_func(test, mock_obj))                         \
                               ~~~~~~~~~       ^~~~~~~~
   lib/kunit/mock-test.c:33:12: note: 'adder_mock_init' declared here
   static int adder_mock_init(struct MOCK(adder) *mock_adder)
              ^
   2 warnings and 1 error generated.
..

vim +/mock_test_struct +54 lib/kunit/mock-macro-test.c

    23	
  > 24	DEFINE_STRUCT_CLASS_MOCK(METHOD(one_param), CLASS(mock_macro_dummy_struct),
    25				 RETURNS(int),
    26				 PARAMS(struct mock_macro_dummy_struct *));
    27	
  > 28	DEFINE_STRUCT_CLASS_MOCK(METHOD(two_param), CLASS(mock_macro_dummy_struct),
    29				 RETURNS(int),
    30				 PARAMS(struct mock_macro_dummy_struct *, int));
    31	
  > 32	DEFINE_STRUCT_CLASS_MOCK_HANDLE_INDEX(METHOD(non_first_slot_param),
    33				 CLASS(mock_macro_dummy_struct), HANDLE_INDEX(1),
    34				 RETURNS(int),
    35				 PARAMS(int, struct mock_macro_dummy_struct *));
    36	
  > 37	DEFINE_STRUCT_CLASS_MOCK(METHOD(void_ptr_return),
    38				 CLASS(mock_macro_dummy_struct),
    39				 RETURNS(void *),
    40				 PARAMS(struct mock_macro_dummy_struct *));
    41	
    42	static int mock_macro_dummy_struct_init(
    43			struct MOCK(mock_macro_dummy_struct) *mock_test_struct)
    44	{
    45		struct mock_macro_dummy_struct *test_struct =
    46				mock_get_trgt(mock_test_struct);
    47	
    48		test_struct->one_param = one_param;
    49		test_struct->two_param = two_param;
    50		test_struct->non_first_slot_param = non_first_slot_param;
    51		return 0;
    52	}
    53	
  > 54	DEFINE_STRUCT_CLASS_MOCK_INIT(mock_macro_dummy_struct,
    55				      mock_macro_dummy_struct_init);
    56	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40928 bytes --]

  reply	other threads:[~2020-10-13  2:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 22:20 [RFC v2 00/12] kunit: introduce class mocking support Daniel Latypov
2020-10-12 22:20 ` [RFC v2 01/12] Revert "kunit: move string-stream.h to lib/kunit" Daniel Latypov
2020-10-13  0:52   ` kernel test robot
2020-10-12 22:20 ` [RFC v2 02/12] kunit: test: add kunit_stream a std::stream like logger Daniel Latypov
2020-10-12 22:20 ` [RFC v2 03/12] kunit: test: add concept of post conditions Daniel Latypov
2020-10-12 22:20 ` [RFC v2 04/12] checkpatch: add support for struct MOCK(foo) syntax Daniel Latypov
2020-10-12 22:20 ` [RFC v2 05/12] kunit: mock: add parameter list manipulation macros Daniel Latypov
2020-10-12 22:20 ` [RFC v2 06/12] kunit: expose kunit_set_failure() for use by mocking Daniel Latypov
2020-10-12 22:20 ` [RFC v2 07/12] kunit: mock: add internal mock infrastructure Daniel Latypov
2020-10-12 22:20 ` [RFC v2 08/12] kunit: mock: add basic matchers and actions Daniel Latypov
2020-10-13  1:51   ` kernel test robot
2020-10-13  1:57   ` kernel test robot
2020-10-12 22:20 ` [RFC v2 09/12] kunit: mock: add macro machinery to pick correct format args Daniel Latypov
2020-10-12 22:20 ` [RFC v2 10/12] kunit: mock: add class mocking support Daniel Latypov
2020-10-13  2:45   ` kernel test robot [this message]
2020-10-12 22:20 ` [RFC v2 11/12] kunit: mock: add struct param matcher Daniel Latypov
2020-10-12 22:20 ` [RFC v2 12/12] kunit: mock: implement nice, strict and naggy mock distinctions Daniel Latypov
2020-11-02 18:00 ` [RFC v2 00/12] kunit: introduce class mocking support Brendan Higgins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202010131023.W6NJA2pb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.