Hardware Reference
In-Depth Information
Chapter 13
Arduino Test Suite
Whether you are creating projects, sketches, or examples, testing is a skill that you will need. When you are developing
a product to share or sell, it is critical that both your hardware and software behave as expected. Having a test helps
people learn about how your project works. The Arduino Test Suite provides a way to prove that your product is
functioning correctly. Incorporating tests into a project helps highlight the fixes and improvements that you have
made. Additionally, using the social coding principles we described in Chapter 2, users are encouraged to submit
issues to http://github.com/arduino/tests , including test examples, to demonstrate problems and verify the
resolution of those problems. The more confidence people have in your product, the better.
The Arduino Test Suite library allows you to create a standard test suite for your own software and the Arduino
software. This library provides a simple, standard way to build these tests. Each test suite run provides output
formatted in the Arduino test result format. This output can be parsed by continuous integration testing software, like
Jenkins, which can be found at http://jenkins-ci.org/ . These tests can be added to your project's official list of
automatic tests, which run every time code is changed in the project's repository.
In this chapter, I will
Go through the basic features of the Arduino Test Suite
Show how the built-in tests can be used with a custom test shield
Provide a basic procedure using the Arduino Test Suite to create a comprehensive test that
tests your project and code libraries
Provide an example of testing memory usage
Show an example of how to test the Serial Peripheral Interface (SPI) library
You are encouraged to create your own tests and submit them as official tests. They way this occurs is that you
would “fork” the project, and create a new tests or modify an existing test for the project in your own repository. Then
send a pull request for the change to the Arduino Test project in GitHub. This process is described in detail described
in Chapter 2. You can also file issues for the project that suggest changes and improvements.
Installing the Arduino Test Suite
The Arduino Test Suite is located on GitHub in the Arduino Tests project, at http://github.com/arduino/tests .
You can download, install, or clone the code into your sketch library folder. In this case, since the Arduino Test Suite
is an Arduino library, the code will be installed in your libraries folder.
You can download the library from the http://github.com/arduino.tests download link, or, if you have
installed Git, as explained in Chapter 2, you can issue the following command from libraries directory:
git clone https://github.com/arduino/Tests ArduinoTestSuite
 
Search WWH ::




Custom Search