I’d like to run unit tests using the mbed stub library under UNITTESTS/stubs.
However, when I add the core directory I get the following error:
*** Multiple ways to build the same target were specified for: C:\WorkDir\UniversalPlatform\WaterSense.pio\build\desktop\lib8c9\stubs\randLIB_stub.o (from [‘C:\users\andi\.platformio\packages\framework-mbed\UNITTESTS\stubs\randLIB_stub.c’] and from [‘C:\users\andi\.platformio\packages\framework-mbed\UNITTESTS\stubs\randLIB_stub.cpp’])
File “C:\users\andi.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py”, line 351, in BuildLibrary
There are both randLIB_stub.cpp and randLIB_stub.c which in the build process would become the randLIB_stub.o object file so there’s a name conflict there. It’s extremely bad that mbed-os names these file the same.
Looking at the content of these files, they also seem really non-sensical
thank you for your detailed reply. Makes sense now. I missed the part with the endings (.c and .cpp)because I didn’t look close enough or was too tired yesterday night. I’ll have a look and try to find a workaround.
I choose not to meddle with the mbed framework and build my application/OS on top of the rtos/ features with pio. Only for unit testing I’d be great to use the stubs. I used to use the mbed way of unit testing but want to streamline the process as the mbed way is kind of tedious.
In addition, I want to have both, unit testing and integration testing in pio since I really like the integration testing with real objects and not mocks/stubs etc.
I’m going to reply later on after I tried some things.