I’m attempting to write some unit tests, which I can do for single commands with a Mock subsystem. However, I’d also like to run some via the top level (ie command based template) robot (I can live without simulating subsystems). This seems to have extensive dependencies on JNI code which fails with the following errors:
java.io.IOException: ntcorejni could not be loaded from path or an embedded resource.
attempted to load for platform /windows/x86-64/
or
java.io.IOException: wpiHaljni could not be loaded from path or an embedded resource.
attempted to load for platform /windows/x86-64/
I see that the WIPILib has an out of process simulator which can be executed via
.\gradlew simulateJava
However running tests after this doesn’t seem to fix the issue. Given there is a Sim option I’m hoping its possible to leverage that for unit testing purposes in some way.
So the question is has anyone worked out how to do this, or can point me in the direction of any docs that explain how to get this working? I’m open to any alternatives that will make unit testing easier.
Thanks