Unit test: runs only one testcase on target

Exact same behavior, i.e. when testcases 3, 5, 6 are activated, 6 is executed twice, the others not.

I followed this tutorial Unit Testing with PlatformIO: Part 1. The Basics | PlatformIO Labs (piolabs.com) and the following post. The charme with my own main() function is that it works for both environments, because, it replaces Arduino’s main(), therefore does not need setup() and loop() any more.

My conclusions:

  • It evaluates the list of RUN_TEST macros, since when I comment single testcases out (or in), the result changes, too. Thus, it does not seem like a refresh issue.
  • Since it works perfectly on the native platform, but not on the target, I assume that is something with the different toolchain or the macro implementation on the other platform.
  • The macro is in \.pio\libdeps\megaatmega2560\unity_internals.h; wheras the implementation for native and Mega2560 is the same. So maybe it is an 8-bit vs. 64-bit issue.
  • There is actually a similar post concerning double testcases. Maybe it relates to the same issue Platformio unit test runs the same test case twice - Advanced Solutions / Unit Testing - PlatformIO Community

Whatever… I am happy that I can at least unit test in the native environment. Should do the job me now.

PS: thanks for helping to far!