Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMock does not support variadic functions #397

Open
dylanlytle opened this issue May 2, 2022 · 1 comment
Open

CMock does not support variadic functions #397

dylanlytle opened this issue May 2, 2022 · 1 comment

Comments

@dylanlytle
Copy link

As stated in #204, cmock does not support variadic functions. I am creating this issue as feature request. There are a lot of scenarios where a debug print provides the only external call with which to validate some logic done in a function.

@glarsennordic
Copy link

glarsennordic commented Jun 29, 2022

That issue is from 2019, is it confirmed that CMock still does not support variadic functions?

Related, open issue: #129

maxd-nordic pushed a commit to maxd-nordic/sdk-nrf that referenced this issue Sep 13, 2022
Make cmock skip generating mock for nrf_modem_at_scanf.
The test suite will now have its own implementation of the mock which
will test the arguments and return a fixed system mode.

This is done as a preparatory step for more unit tests that depend on
CMock skipping the mock generation for nrf_modem_at_scanf.

The reason why we want to skip generation of mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
balaji-nordic added a commit to balaji-nordic/sdk-nrf that referenced this issue Sep 13, 2022
Make cmock skip generating mock for nrf_modem_at_scanf.
The test suite will now have its own implementation of the mock which
will test the arguments and return a fixed system mode.

This is done as a preparatory step for more unit tests that depend on
CMock skipping the mock generation for nrf_modem_at_scanf.

The reason why we want to skip generation of mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
tejlmand pushed a commit to tejlmand/fw-nrfconnect-nrf that referenced this issue Nov 28, 2022
Make cmock skip generating mock for nrf_modem_at_scanf.
The test suite will now have its own implementation of the mock which
will test the arguments and return a fixed system mode.

This is done as a preparatory step for more unit tests that depend on
CMock skipping the mock generation for nrf_modem_at_scanf.

The reason why we want to skip generation of mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
trantanen pushed a commit to trantanen/sdk-nrf that referenced this issue Dec 1, 2022
Introduce EXCLUDE argument for cmock CMake functions.
This allows tests to disable mock generation for functions that should
not be mocked or functions where hand-written mocks should be used.

The reason to skip generation of a mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
trantanen added a commit to trantanen/sdk-nrf that referenced this issue Dec 1, 2022
The reason why we want to use custom mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
nordicjm pushed a commit to nrfconnect/sdk-nrf that referenced this issue Dec 1, 2022
Introduce EXCLUDE argument for cmock CMake functions.
This allows tests to disable mock generation for functions that should
not be mocked or functions where hand-written mocks should be used.

The reason to skip generation of a mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
nordicjm pushed a commit to nrfconnect/sdk-nrf that referenced this issue Dec 1, 2022
The reason why we want to use custom mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
gWacey pushed a commit to gWacey/sdk-nrf that referenced this issue Dec 6, 2022
Introduce EXCLUDE argument for cmock CMake functions.
This allows tests to disable mock generation for functions that should
not be mocked or functions where hand-written mocks should be used.

The reason to skip generation of a mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
gWacey pushed a commit to gWacey/sdk-nrf that referenced this issue Dec 6, 2022
The reason why we want to use custom mock is because CMock does
not have good enough support for variadic functions.
Related issue: ThrowTheSwitch/CMock#397

Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants