Skip to content
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

Example sketches with tests? #139

Closed
dhempy opened this issue Apr 13, 2020 · 9 comments
Closed

Example sketches with tests? #139

dhempy opened this issue Apr 13, 2020 · 9 comments
Labels
docs Documentation enhancement New feature or request

Comments

@dhempy
Copy link

dhempy commented Apr 13, 2020

Feature Request

Can anyone point to some open source repos that use arduino_ci? The documentation here seems quite complete at the detail level...but a little challenging to put all together for a newbie Arduino developer.

In my case, I'm thoroughly comfortable with unit testing from years of Ruby testing with rspec. I'm just struggling with a bit of the glue to bring it all together on this platform. Once I see the patterns in place and get my first test running, I'm sure all the detail docs will answer my questions.

I'm happy to put contribute to to documentation if you all can point to a few good quality examples.

Thanks in advance.

@ianfixes
Copy link
Collaborator

The documentation here seems quite complete at the detail level...but a little challenging to put all together for a newbie Arduino developer.

That's pretty accurate. Did the documentation at least take you as far as the DoSomething sample project? That is meant to be a bare-bones example of how to put the test fixtures in place.

As far as open source projects, I opened pull requests on a few of them since I had used those libraries as test cases for developing my library:

Is this more or less what you're looking for? I'd gladly accept a GettingStarted.md from an actual newbie's perspective!

@ianfixes ianfixes added docs Documentation enhancement New feature or request labels Apr 13, 2020
@dhempy
Copy link
Author

dhempy commented Apr 13, 2020

Thanks for those links, Ian. I think I found the README for DoSomething...but perhaps glossed over the fact that I was only looking at the readme, missing the fact that there was a whole project underneath it to explore. blush

I did not find the TestSomething project. After a few minutes of browsing, I'm still not clear on the difference between the two, but I'll spend some time exploring both.

And thanks for the links to real-world projects using your tool. I'll look at a few of them, as well.

I'm totally game to write up something if it is fruitful.

@dhempy
Copy link
Author

dhempy commented Apr 13, 2020

ps. This is the project we're building: https://github.com/dhempy/air-assist
It is an open-source ventilator for COVID-19 overflow patient. You can learn more about it here: https://www.vent.guide/

@ianfixes
Copy link
Collaborator

TestSomething is more of a dummy project that I use to test the arduino_ci library itself ... I have a few hardware mocks and this was the easiest way to unit test them. I don't think it would offer much in the way of good examples for what you're working on.

As far as your code goes, arduino_ci can only really work on an arduino library, not an arduino sketch. So if you factor your code into classes such that the standard arduino functions like setup() and loop() are just thin wrappers around library functions.

@ianfixes
Copy link
Collaborator

but perhaps glossed over the fact that I was only looking at the readme, missing the fact that there was a whole project underneath it to explore

That's a good indication that the README could use some improving! I'll take any suggestions you have there for how to make the example-project-ness of it stand out.

@jgfoster
Copy link
Member

jgfoster commented Sep 9, 2020

@dhempy, Having faced the same learning curve, I developed Blink as a template. You can also watch a video of the process.

@ianfixes, At first I was intending to add Blink to your SampleProjects, but now that I understand that we can use arduino_ci without downloading this project it makes more sense to me to have a small demo/template people can use to start. Does that make sense?

Advice, suggestions, and corrections are welcome.

@ianfixes
Copy link
Collaborator

ianfixes commented Sep 9, 2020

we can use arduino_ci without downloading this project

I'm calling out this point in particular because it sounds like I don't do a good job in the docs of explaining precisely this.

makes more sense to me to have a small demo/template [i.e. "Blink"] people can use to start.

I agree completely. The problem for me was that as this project evolved, it was difficult to keep the sample project in proper sync with the feature set (I'd change a function name in the codebase but not the sample project). So by testing the sample projects as part of arduino_ci's own CI, it helped me keep those updated. At the expense of standalone examples.

But conceptually, you're right -- it leads to confusion. I think a standalone repo is probably the best way to accomplish the starter template idea you're talking about.

@ianfixes
Copy link
Collaborator

@dhempy I assume that #139 (comment) will satisfy your needs here, if not then please reopen with more information about what is missing

@dhempy
Copy link
Author

dhempy commented Jan 21, 2021

Thank you, @ianfixes and @jgfoster !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants