UnitTesting example calculator file/folder layout seems only to work with single component in native and embedded environment
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 50/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- documentation, embedded-iot, testing-qa
Research direction
Start with the unit-testing/calculator example and inspect test/test_embedded and test/test_desktop, especially their main, setUp, and tearDown definitions. Verify the failure by adding multiple test files, then make the example and accompanying documentation support an extensible layout without duplicate definitions.
Written by the indexing model from the issue text.
Description
The unit testing example calculator aims to show how to use unit testing with native and embedded environments (with the Unity testing framework). The suggested file/folder structure and the contents of the test components test_embedded and test_desktop however only seem to work with a single test file - due to the definition of main and setup/loop. When adding multiple test files with that structure we certainly get compilation errors like this:
multiple definition of `main'; .....cpp:(.text+0x5f): first defined here
Besides the setUp and tearDown function will cause duplicates as well. It seems that one would have to move the main function to a separate file and reference all the other tests from there.
I am just pointing this out, as the file/folder structure after such a change would differ greatly from the example and the accompanying documentation. And this - imo - makes it a mediocre example.
I would like to see a unit test example that can easily be extended and be used in a real life project. Maybe I am missing something here, then pls tell me so and I am more than happy to delete/close this issue.
Thank you for your help and support.
- Dominant language
- C++
- Stars
- 703
- Forks
- 198
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from platformio/platformio-examples
-
can support FMDOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in platformio/platformio-examples
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug compatibility difficulty:easy prio:normal
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NatronGitHub/openfx-misc#524 ·
Maintainers usually reply within 1 day
-
documentation enhancement help wanted P0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openscad/openscad#7360 · 2 comments ·
Maintainers usually reply within 1 day