-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnitTesting example calculator file/folder layout seems only to work with single component in native and embedded environment #43
Comments
yes, I have read it. But obviously, I must have missed sth, otherwise you would not have asked ... I now adjusted the
This gets me all embedded test skipped when building native and the other way round. However, I still have the problem, I cannot have more than one test file in a single Does the documentation really state, to have only one test file per folder? that in turn would mean, I would have to combine all the tests for a lib in a single test file - or have multiple folders for one component. Pls do get me right - I am not complaining. It is just, that I would have hoped that the example would be a little bit more comprehensive or adjustable. I would be interested in the best current practice from PlatformIO's point of view on how to do this. And an easy thing would be to express that view via one of the examples. You can easily close the issue and I will find a workaround for myself. Thanks anyway for the quick reply and the good work on PlatformIO. |
@ivankravets I got a working example for myself (Unity and ESPIDF (not Arduino)) and could contribute this here, if interest exists. |
Hi Ronald, Thanks for your feedback! Of course, we would be happy if you help us improve documentation and examples. Could you provide a PR? |
Yep, will do so. |
@ivankravets Sorry for taking so long, but there was sth I had to handle with more priority. I am ready to submit the PR and just wanted to know what the contents of the license header/file should be. Thank you for your advice. |
The unit testing example
calculator
aims to show how to use unit testing withnative
andembedded
environments (with the Unity testing framework). The suggested file/folder structure and the contents of the test componentstest_embedded
andtest_desktop
however only seem to work with a single test file - due to the definition ofmain
andsetup/loop
. When adding multiple test files with that structure we certainly get compilation errors like this:Besides the
setUp
andtearDown
function will cause duplicates as well. It seems that one would have to move themain
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.
The text was updated successfully, but these errors were encountered: