Tests don't include WPILib #16
|
The behavior you get is the expected; running WPILib requires the robot, it's ports and motors, etc. The |
|
This specific code that I wanted to test was a class that implements PIDSource but otherwise is unconnected to robot code, which seems like something that should be testable. That said, I understand the reasoning behind limiting it. |
|
Another thing that you could do if you are interested is using a fake WPILib like 254's, which would allow you to run WPILib like code without the robot. You would have to make a jar for that library and then add it to the |
When I'm making tests and compiling with
ant test, it errors with something like the following if it includes any WPILib referencing code. It can however run test files just fine for code that doesn't import WPILib code.My code: https://github.com/Nashoba-Robotics/2016-Pre-Season-Drivetrain
I tried adding
<pathelement location="lib/wpilib/java/current/lib/WPILib.jar" />to build.xml inside of
<path id="classpath.test"> ... </path>, but that causes it to error withThis log (https://api.travis-ci.org/jobs/109041196/log.txt?deansi=true) with this commit (Nashoba-Robotics/Nashoba-Robotics2016@a99afda) shows the main error.