I’m building a custom library for our team, to make it easier to port over our common classes across various projects, and I’m encountering a small issue.
I’ve been doing unit testing via Mockito for a while now, and I want to port this unit testing to my custom library. It runs correctly in one project (PurpleSwerve), but when I run it in our library project (PurpleLib) it runs, but VSCode doesn’t show the test results/status, i.e, I don’t get a green check or red X to show pass/fail. Namely I would like to port over LEDSubsystemTest.java from PurpleSwerve to PurpleLib.
Note, I add HAL.initialize(100, 0); when I copy over that LED test to the PurpleLib project.
Hmm, I still have an issue after moving the tests to the proper location. The JSONObjectTest works fine, but LEDSubsystemTest doesn’t.
I get the following error:
java.io.IOException: wpiHaljni could not be loaded from path or an embedded resource.
attempted to load for platform /linux/x86-64/
Last Load Error:
no wpiHaljni in java.library.path: [/home/vignesh/Documents/source/PurpleLib/build/jni/release]
Figured it out, I was missing a few things in the dependencies section in my build.gradle and I didn’t run “Test robot code” from the VSCode command palette first, to get it to bring in the JNI libraries.