Hardware Reference
In-Depth Information
info.Test-Suite-Name = My bare bones tests
info.Free-memory = 1464 bytes
My bare bones test ... ok
--------------------------
Ran 1 tests in 1.371s
OK
The final OK shows that all tests passed and took a total time of 1.31 seconds. They passed because we created
a result variable that held a true value, which was then passed to the ATS_PrintTestStatus() function. It has this
function signature:
void ATS_PrintTestStatus( char *testString , boolean passed );
This char *testString is the test name, and boolean passed is the test result.
Arduino Test Result Format
The Arduino test result format is based on the standard test format used by the Nose testing library from Python
( https://nose.readthedocs.org/en/latest/ ) . This format uses verbose mode so that all tests are listed with their
outcomes. The output of the format is compatible with several different automated test systems. Since memory is
limited and we want to preserve it for the tests as opposed to the testing library, this format is not based on an XML
format. Each test must be discrete, and if one element fails, the incomplete XML file will be invalid and unusable.
However, you can parse the output and change it to an xUnit test structure.
Another common use of the Arduino Test Suite is to use it to test the compiler toolchain to ensure that the
compiler, and it's support programs running your code properly. It is important for nonstandard compilers to check
if an Arduino compiler upgrade is compatible with the Arduino API. The result format has a set of common data that
allows you to know what toolchain your code is being compiled against. This is helpful because you can verify an
upgraded GCC compiler or AVR-libc and be assured that your code functions, thanks to a passing test result. Another
feature of the format is the ability to identify the manufacturer so you know what platform and microcontroller you are
testing against. This way, you can test an entire family of Arduinos and clones and know that they are compatible with
your code, libraries, or project. Each test has a date, time, and name, so you can keep track of the different tests.
Test Result Section Format Details
The test result file begins with information data. This is indicated by the info. at the beginning of the line, as shown in
Listing 13-4.
Listing 13-4. Test Header Info Fields
info.MANUFACTURER = Arduino
info.CPU-NAME = ATmega328P
info.GCC-Version = 4.3.2
info.AVR-LibC-Ver = 1.6.4
info.Compiled-date = Oct 4 2010
info.Test-Suite-Name = general
The header information section is followed by the test section, which includes the test results.
 
Search WWH ::




Custom Search