Open tomh4 opened 3 years ago
You will need to replace arm_math library with standard math library. :includes:
option provides :release:
and :test:
submembers for this. Alternatively you can also do it via the :tools:
for the :test_compiler:
and :test_linker:
. If there are functions that you want to mock instead (different from standard math), then I suggest you just add the header files somewhere to mock these functions.
Hello, yes the problem is we have some very specific methods we are using (e.g. arm_biquad_cascade_df2T_f32) that are not so easily replaced by the standard math libs.
Mocking does not work as the outcome of the test does depend on the these functions, or am I missing something here?
You are not executing on target, so you do not depend on these functions. You depend on the results of these functions = > mocking. Your intention is not to verify that those functions do what they do, your intention is to separate the functionality of your functions and that means not going deep into such non-standard special math functions.
They are probably full of assembly, so they might not even compile correctly anyway.
You are probably right, we thought we could test the correct usage of the functions ( not their functioning ).
But we will then just skip all the methods that rely on these functions to produce a correct outcome!
We have successfully set up Ceedling to run tests for our STM32L4 project but we are struggling with the arm_math library.
How would one go about testing a method that makes use of any of the methods in such a platform specific library? I tried adding the library to the project and also added the define for library ( arm_cortexM4lf_math ) but of course this does not work as we are not running the tests on a cortex m4...
Any suggestions we could try out ?