Unit Testing: java.io.IOException: wpiHaljni

Cool. Apparently getting reports it works on linux and mac too. We can actually include it now, the ${workspaceFolder} trick didn’t work a few months ago.

@JohnGilb would you be able to try the above too? It should work in VS Code by default, no need to add the extra libraries anymore.

I’ve been running code in Intellij, on Mac. Ironically, this make me much less likely to meddle in the kids’ work, and focus on the mentoring aspects.
One thing I’m hoping to teach this year is how testing can prove your algorithms are working. So adding a lot of mocking and such is far too abstract for their current skill level, and I was trying to focus on the simplest kinds of unit tests.
Was frustrated that even simple seeming methods like Filesystem.getDeployDirectory() needed the HAL setup.
As long as the build & test can be executed automatically when uploaded to a place like github, things are awesome. e.g travis: https://travis-ci.org/GwhsRobotics3/SwerveDriveSpark

I might have a solution for intelliJ to from some things I learned today, and I’ll try and see if it works, but I can’t guarantee it, especially with intellij being unofficial.

The reason the HAL is needed is that is the way we are able to keep the high level code identical for simulation and testing and for robot code. By doing the platform change in native code, we only have to write simulation support once. The hard part about this is a few functions that are in about every class we use talk to the HAL for either usage reporting, or actually detecting simulation (Detecting simulation uses a function in the hal to detect desktop or not), so pretty much everything has to load the native libraries. And because of how native loading works, it can’t just run the Java code and magically have everything work.

I know it’s certainly easier to ask for features than implement them! I’ll see what I can do with the above that gets the team the most bang for the buck.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.