Wallacoloo / printipi

3d printing directly through the Raspberry Pi's GPIO pins
MIT License
141 stars 43 forks source link

Restructure Testsuites #66

Closed Wallacoloo closed 9 years ago

Wallacoloo commented 9 years ago

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.

Wallacoloo commented 9 years ago

Implemented in devel.