13 September 2014
Project is located here: NeoPixels
All test code will be use Google Mock and Google Test. All testing will be done on the host.
Pure interfaces classes will be written to abstract the Arduino code from the lighting control algorithm. Four interfaces and implementation have been created:
The tests will focus enforcing the calling of the I2C and ILighting objects interfaces using mocked classes. The actual implementation of the I2C and ILighting layer will be tested on the hardware with the goal of the interfaces staying as close to the hardware as possible to minimize the amount of physical hardware testing required. The interfaces will also not expose implementation details, e.g. the interfaces should not make assumptions of the underlying hardware (in the event, it changes).
The Lighting control object will accept both ITimer and ILighting object which will allow mock objects to be inserted during test.
LightingIrisImpl lights;
LightingControl::initialize( &lights,
&GLOBAL_TIMER );
The Lighting Control Object (LCO) was designed with the following requirements:
Events can be queued:
LightingControl::queueLightSequence( LightingControl::LightSequence_SystemCheck );
The main loop in the Arduino will drive the system using a global event timer ITimer.
void loop()
{
GLOBAL_TIMER.update();
}