Right now, not much functionality is actually tested - just the State acknowledging gcodes, and some IoPin stuff. What would be ideal is that you can send the gcode command to set servo 1 to 45 degrees and then check that the servo's internal state actually reflects that command, for example.
Probably the best way to do this is to create a new header file, testsuitebase.h, that defines a class that can aid in testing. This TestSuiteBase class would allow one to instantiate a basic Machine containing a set of IoDrivers given as function arguments, a CoordMap given as a function argument, etc (all should be optional), and also set up a State to listen for gcodes. Then the actual test class could call testSuiteBase.sendCommand("M280 P0 S45") to put a servo to 45 degrees and then inspect its state.
This would allow for each class to test its own behavior as it interacts with the entire program.
Right now, not much functionality is actually tested - just the State acknowledging gcodes, and some IoPin stuff. What would be ideal is that you can send the gcode command to set servo 1 to 45 degrees and then check that the servo's internal state actually reflects that command, for example.
Probably the best way to do this is to create a new header file,
testsuitebase.h
, that defines a class that can aid in testing. This TestSuiteBase class would allow one to instantiate a basic Machine containing a set of IoDrivers given as function arguments, a CoordMap given as a function argument, etc (all should be optional), and also set up a State to listen for gcodes. Then the actual test class could calltestSuiteBase.sendCommand("M280 P0 S45")
to put a servo to 45 degrees and then inspect its state.This would allow for each class to test its own behavior as it interacts with the entire program.