Basic unit testing of OneWire using TravisCI + arduino_ci #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relating to discussion in arduino/Arduino#7567 , I've added CI capability + some unit tests to this repository using Travis CI and arduino_ci. I'm not an expert on the OneWire protocol itself, so the contributions will seem rather ignorant -- not least because I simply made the "actual behavior" into the "expected behavior" for the following functions:
OneWire::crc8()
OneWire::crc16()
oneWire->write_bit()
oneWire->write()
The CI will execute those unit tests, as well as compilation tests of all examples, on the platforms defined in
.arduino-ci.yaml
(currently justdue
; I wasn't sure which platforms are relevant).Of course, Travis needs to be enabled for this repository first. You can test it locally (as I did) with a ruby 2.0 environment, by running the following:
Enabling Travis
This is the place where the automated tests will be: https://travis-ci.org/PaulStoffregen/OneWire
Use your GitHub login to register for Travis. This is required
-- | --
| Once logged in, you can Sync your account and Search for the repository you want to automate
(via)
This was a fun exercise -- the OneWire library helped me unearth a few compilation errors and other shortcomings in my test library.