Replies: 6 comments 5 replies
-
For implementing platform-dependent filters, I think |
Beta Was this translation helpful? Give feedback.
-
When excluding private libraries (3rd party libraries) or actually any files from build, one will have to mock those. It does not matter if those files are from 3rd party code, using third party code (adapters) or using adapters. |
Beta Was this translation helpful? Give feedback.
-
🤔 "Thinking out loud":
👉 In conclusion:
Implementing this means that I would not use ArduinoFake for testing any more. As I would have no dependency to |
Beta Was this translation helpful? Give feedback.
-
Oh boy, I'm still not overviewing the total scope of the problem😅 Isn't the library.json approach the best of both worlds? Going down the library.json rabbit hole, I thought: If we spent so much effort in bending PlatformIO to our needs, maybe we should think of leaving it behind and go for other alternatives, like your CMAKE or ESP-IDF? |
Beta Was this translation helpful? Give feedback.
-
Hm well I checked the recent changed file just now 😅 there is already a decission. |
Beta Was this translation helpful? Give feedback.
-
For the record: Most of the issues were resolved by #102. Remaining issues have been transferred to #105. |
Beta Was this translation helpful? Give feedback.
-
We automatically run tests using the "native" build environment. The native build environment is the test environment available on standard desktop environments and on the continuous integration server.
Some of our code has dependencies to 3rd party libraries/code. And some of those libraries may not be compatible to the native build environment.
It is not necessary to test 3rd party libraries themselves.
It must be noted that the build management tool currently used (PlatformIO) does not support fine tuning the selection of sources to be compiled for test execution via the projects' build configuration (
platformio.ini
). Libraries can be partially compiled using alibrary.json
file to filter files depending on the target build system. Apart from this libraries are build as a whole.Mocking dependencies is technically possible but not effortless. Libraries such as ArduinoFake can simplify mocking. But currently we use extensions from the Espressif Arduino framework. Those are not covered by ArduinoFake.
The used libraries do not (always) provide interfaces which are compatible to the test environment. That means, in general, that one needs to implement stubs for the 3rd party dependencies.
A possibility to avoid stubbing would be to avoid compiling code for tests which has dependencies to 3rd party code. The code which is then not tested on the native test environment should be kept to a minimum. These are the 3rd party library adapters. This code should be as simple as possible to reduce the risk of introducing errors. Those adapters are then excluded from testing using the native build environment.
I conclude these are the possibilities:
library.json
files for the (private) libraries to selectively exclude source files from testing which are incompatible to the build environment.What are your thoughts on this? @FiveTeethless do you have any preferences?
Beta Was this translation helpful? Give feedback.
All reactions