Thanks for the info.
I knew jstest-gtk. I didn't know it is available via console, too.
I'm gonna test it with a USB gamepad first, to check if it's what I need (I suppose so). NES/SNES controllers test will take a while, since I need to prepare the interconnection board. Maybe I will do a quick test with jumpers.