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

Unit tests? #22

Closed
leg0 opened this issue Nov 16, 2018 · 4 comments
Closed

Unit tests? #22

leg0 opened this issue Nov 16, 2018 · 4 comments

Comments

@leg0
Copy link
Contributor

leg0 commented Nov 16, 2018

I was wondering if there are any plans to start using unit tests in this project? Any plans to run them in a continuous integration server? There are some free CI servers, for example Travis CI, Azure Devops, etc.

As part of a pull request I would like to provide a set of unit tests to demonstrate that my changes actually work (at least the way I intended them to).

@facchinm
Copy link
Member

Hi @leg0 ,
absolutely 🙂 We already have many unit test running on real boards but a community driven, hardware agnostic test suite would be awesome.
In the meantime, feel free to provide any test sketch with your PRs, maybe based on https://github.com/mmurdoch/arduinounit .

@ianfixes
Copy link

Is this a request to unit test the library itself, or to provide an ability to mock this library for the purposes of unit testing 3rd-party Arduino libraries?

Asking as the maintainer of the arduino_ci project.

@leg0
Copy link
Contributor Author

leg0 commented Jan 18, 2021

In short, it's a request to have a place to put unit tests for a code in this repo.

When I created this question, i had a PR that I had some tests, but I did not see any unit testing framework being used in this project. So including a set of unit tests that nobody would run seemed like a waste, and as a result that test code would probably rot and not be able to run anyway after a while. If there are plans to add unit testing to this project, it would be helpful to know which testing framework is going to be used. And once that is available, running the tests as part of CI pipeline would then become a possiblity.

@per1234
Copy link
Collaborator

per1234 commented Jan 18, 2021

Hi @leg0. Some nice advancements have been made in this area since the time you created the issue. You can see the unit tests here:
https://github.com/arduino/ArduinoCore-API/tree/master/test/src

They are using the Catch2 test framework.

These test are run by the GitHub Actions-based CI system:
https://github.com/arduino/ArduinoCore-API/blob/master/.github/workflows/unit-tests.yml
https://github.com/arduino/ArduinoCore-API/actions?query=workflow%3A%22Unit+Tests%22
and code coverage reports are published on Codecov (96% coverage!):
https://codecov.io/gh/arduino/ArduinoCore-API

@leg0 leg0 closed this as completed May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants