A complete test would obviously be something fairly complex, and would
probably require building some sort of rig. You can, however, perform a
minimal test that checks for common failure modes, without connecting
any extra hardware.
I assume the pin I/O stages are the easiest thing to break. You can then
check that, when you read a pin that is set to OUTPUT, ...
Testing microcomputers is a very complicated task. In your case I would suggest writing some programs to do exactly what you are saying. Then let the students do the testing. When the class starts you have to teach them the basics, this will check the computers etc and also the test equipment on there benches. At the end of testing they will have knowledge ...
I eventually switched to PlatformIO. It took me less than half an hour to rearrange sources, fix some compiler issues, build and flash my device.
Tests work really well. You just need to keep tested sources in lib folder. I even got GoogleTest package so I can use gmock in my tests.